mirror of
https://github.com/amnezia-vpn/amneziawg-linux-kernel-module.git
synced 2026-10-13 21:34:34 +00:00
[PR #247] fix: bound aggregate junk spec size #259
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
amnezia-vpn/amneziawg-linux-kernel-module#259
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/pull/247
Author: @HeisLuka
Created: 9/14/2026
Status: 🔄 Open
Base:
master← Head:fix/junk-spec-size-overflow📝 Commits (1)
48f3599fix: bound aggregate junk spec size📊 Changes
1 file changed (+7 additions, -0 deletions)
View changed files
📝
src/junk.c(+7 -0)📄 Description
Summary
Restore an upper bound on the aggregate I1-I5 CPS packet size and validate it before adding each tag length.
jp_spec_setup()currently sumstag->pkt_sizevalues in a signedintand then uses the result forkzalloc(). Large positive<r>,<rc>, or<rd>lengths can therefore overflow the accumulator or request an oversized standalone junk packet.Older versions of the module rejected CPS packets larger than
MESSAGE_MAX_SIZE(65535 bytes). That guard disappeared during the AWG 3.x refactor.This change restores the 65535-byte aggregate ceiling and checks each
tag->pkt_sizeagainst the remaining space before addition, so the accumulator cannot overflow.The aggregation check also rejects a negative tag length defensively. Parser-level rejection of negative lengths remains handled separately by #237.
Scope
This only changes CPS spec validation in
jp_spec_setup(). Valid I1-I5 specs up to the historical 65535-byte limit are unchanged.Related to #233
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.