CVE-2026-99835: net/packet: check TX_RING fragments before memory accounting
In the Linux kernel, the following vulnerability has been resolved:
net/packet: check TXRING fragments before memory accounting
tpacketfillskb() adds the full non-linear payload length to skb->truesize and skwmemalloc before checking MAXSKBFRAGS. With PACKETVNETHDR, userspace can submit a ring-sized frame even when it greatly exceeds the device MTU.
A near-INTMAX frame can saturate skwmemalloc before the fragment loop rejects it. A subsequent refcountadd(0x40000001) can temporarily turn REFCOUNTSATURATED into 1. A concurrent TX completion can then drop that apparent last reference and free the still-live packet socket before refcountwarnsaturate() restores the counter.
Check that the remaining payload fits in MAXSKBFRAGS pages before accounting it. Include the initial page offset in the calculation, and move the existing -EFAULT handling out of the fragment loop. This preserves the accepted packet sizes and error code while preventing an invalid frame from injecting an oversized byte charge.
[edumazet: use netwarnratelimited() instead of prerr(), add a Fixes: tag]
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.10.275 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.15.226 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.1.193 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.6.163 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.117 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.63 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.4 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.117-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.4-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.117-1Fixed in 7.3.4-1
Event History
Frequently Asked Questions
What conditions are required to trigger this issue?
An attacker needs the ability to submit crafted transmit-ring frames through an AF_PACKET socket using PACKET_VNET_HDR. The problematic input is a ring-sized frame that greatly exceeds the device MTU, potentially approaching INT_MAX in size.
What is the security impact of successful exploitation?
The oversized memory accounting can saturate sk_wmem_alloc and temporarily change a saturated reference count to 1. A concurrent transmit completion may then free a packet socket that is still in use, creating a use-after-free condition.
Does the fix change valid packet-size handling or error behavior?
No. The fix checks whether the remaining payload fits within MAX_SKB_FRAGS pages before memory accounting, while preserving accepted packet sizes and the existing error code for invalid frames.