inet: frags: bound the wmem charge of the socket completing a reassembly
- CVE-2026-139793
- GHSA-9xwx-hp55-684h
- EUVD-2026-139499
Description
Show the whole descriptionHide the whole description
In the Linux kernel, the following vulnerability has been resolved: inet: frags: bound the wmem charge of the socket completing a reassembly When a socket owned fragment completes a reassembly queue, inet_frag_reasm_prepare() and inet_frag_reasm_finish() charge the truesize of all other fragments to its sk_wmem_alloc. These fragments were orphaned when queued, and might have been sent by someone else, for instance padded TUN packets. Commit 3ae20e4697eb ("inet: frags: limit the truesize of a reassembly queue") bounds this charge to INT_MAX / 2 per queue, but a socket can complete several queues while the reassembled skbs are still alive, for instance held in a qdisc. sk_wmem_alloc can then go past INT_MAX, refcount_add() saturates it with a WARN, and the socket is leaked. This is reachable from an unprivileged user/network namespace, by raising ipfrag_high_thresh. Refuse the reassembly if the charge would push sk_wmem_alloc above 2 * sk_sndbuf, the bound ip_append_data() uses, plus 4MB of slack for fragments inflated by a refragmentation with a small MTU, and never above INT_MAX / 2. The cap matters for tun sockets, which use sk_sndbuf = INT_MAX, and whose skbs are still owned when act_ct or openvswitch reassemble them at ingress. Several queues can complete at the same time on different cpus for the same socket, so the charge is reserved with a cmpxchg() loop in inet_frag_reasm_prepare(), before it modifies the queue, and settled in inet_frag_reasm_finish(). Move the size checks of ip_frag_reasm(), ip6_frag_reasm() and nf_ct_frag6_reasm() before inet_frag_reasm_prepare(), using the first fragment which becomes the head, so that a successful inet_frag_reasm_prepare() is always followed by inet_frag_reasm_finish(). All callers already kill the queue when inet_frag_reasm_prepare() returns NULL. Found by code inspection (AI review), not reproduced.
Text from the CVE.org record.
Recommendation
Linux
- If you run 6.6.xupdate to 6.6.163 or laterPatch update: breaking changes are unlikely
- If you run a version from 6.1.85 to before 6.2update to 6.2 or laterMinor version change: check the release notes
- If you run a version from 5.15.168 to before 5.16update to 5.16 or laterMinor version change: check the release notes
- If you run a version from 5.10.227 to before 5.11update to 5.11 or laterMinor version change: check the release notes
- If you run a version from 5.4.285 to before 5.5update to 5.5 or laterMinor version change: check the release notes
Some affected versions have no stated fix.
Taken from the version ranges of the CVE.org record. Check the vendor advisory: nothing is said about versions the ranges do not list. Breaking-change risk is read from the version numbers only.
Affected
Linux
Affected versions Fixed in from 6.6.26 to before 6.6.163 6.6.163 from 6.1.85 to before 6.2 6.2 from 5.15.168 to before 5.16 5.16 from 5.10.227 to before 5.11 5.11 from 5.4.285 to before 5.5 5.5 from 6.8.5 to before 6.9 none stated 6.9 none stated before 6.9: not affected none stated and 5 more
Product versions from the CVE.org record.
Timeline
- Published
Related news
No article from the followed outlets names this vulnerability.