mirror of
https://github.com/amnezia-vpn/amneziawg-linux-kernel-module.git
synced 2026-10-13 21:34:34 +00:00
[PR #235] fix: guard invalid junk packet size range #248
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#248
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/235
Author: @HeisLuka
Created: 9/14/2026
Status: 🔄 Open
Base:
master← Head:fix/jmin-jmax-range-validation📝 Commits (1)
8c3dec8fix: guard invalid junk packet size range📊 Changes
1 file changed (+10 additions, -5 deletions)
View changed files
📝
src/send.c(+10 -5)📄 Description
Summary
Snapshot
Jc,JminandJmaxbefore generating dummy junk packets and usethose values consistently for both the allocation size and the random packet
size range.
If an invalid
Jmin > Jmaxpair is observed, clampJmintoJmaxbeforecalling
get_random_u32_inclusive().This prevents an invalid or transiently inconsistent range from underflowing
inside the random range calculation and producing a packet size larger than
the
Jmax-sized buffer.Using a single snapshot also avoids mixing old and new
Jmin/Jmaxvaluesif the device configuration is updated while a handshake worker is running.
Scope
This PR addresses only the
Jmin > Jmax/ inconsistent-range part of #225.The unchecked
kzalloc()result reported in the same issue is intentionallyleft for a separate change.
Related to #225
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.