{"id":"CVE-2026-139793","state":"PUBLISHED","title":"inet: frags: bound the wmem charge of the socket completing a reassembly","description":"In the Linux kernel, the following vulnerability has been resolved:\n\ninet: frags: bound the wmem charge of the socket completing a reassembly\n\nWhen a socket owned fragment completes a reassembly queue,\ninet_frag_reasm_prepare() and inet_frag_reasm_finish() charge the\ntruesize of all other fragments to its sk_wmem_alloc. These fragments\nwere orphaned when queued, and might have been sent by someone else,\nfor instance padded TUN packets.\n\nCommit 3ae20e4697eb (\"inet: frags: limit the truesize of a reassembly\nqueue\") bounds this charge to INT_MAX / 2 per queue, but a socket can\ncomplete several queues while the reassembled skbs are still alive,\nfor instance held in a qdisc. sk_wmem_alloc can then go past INT_MAX,\nrefcount_add() saturates it with a WARN, and the socket is leaked.\n\nThis is reachable from an unprivileged user/network namespace, by\nraising ipfrag_high_thresh.\n\nRefuse the reassembly if the charge would push sk_wmem_alloc above\n2 * sk_sndbuf, the bound ip_append_data() uses, plus 4MB of slack for\nfragments inflated by a refragmentation with a small MTU, and never\nabove INT_MAX / 2. The cap matters for tun sockets, which use\nsk_sndbuf = INT_MAX, and whose skbs are still owned when act_ct or\nopenvswitch reassemble them at ingress.\n\nSeveral queues can complete at the same time on different cpus for\nthe same socket, so the charge is reserved with a cmpxchg() loop in\ninet_frag_reasm_prepare(), before it modifies the queue, and settled\nin inet_frag_reasm_finish(). Move the size checks of ip_frag_reasm(),\nip6_frag_reasm() and nf_ct_frag6_reasm() before\ninet_frag_reasm_prepare(), using the first fragment which becomes the\nhead, so that a successful inet_frag_reasm_prepare() is always followed\nby inet_frag_reasm_finish(). All callers already kill the queue when\ninet_frag_reasm_prepare() returns NULL.\n\nFound by code inspection (AI review), not reproduced.","publishedAt":"2026-11-30T13:38:03.174Z","updatedAt":"2026-11-30T13:38:03.174Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"f4877225313d474659ee53150ccc3d553a978727","status":"affected","lessThan":"2970a56311e4b26e12acdc9c53887243283e8b02","versionType":"git"},{"version":"18685451fc4e546fc0e718580d32df3c0e5c8272","status":"affected","lessThan":"6ee928d489fae99aa2108dff346b5afa142b9d3d","versionType":"git"},{"version":"18685451fc4e546fc0e718580d32df3c0e5c8272","status":"affected","lessThan":"dad6663a5dbf5f23c5921f0e2d0709560d388fa6","versionType":"git"},{"version":"18685451fc4e546fc0e718580d32df3c0e5c8272","status":"affected","lessThan":"38f0414192e7ed0a7f250a64d5dfacd6d6139098","versionType":"git"},{"version":"18685451fc4e546fc0e718580d32df3c0e5c8272","status":"affected","lessThan":"b71c101bbb9814d163c00234d43c41f0a17907d4","versionType":"git"},{"version":"1b6de5e6575b56502665c65cf93b0ae6aa0f51ab","status":"affected","versionType":"git"},{"version":"9705f447bf9a6cd088300ad2c407b5e1c6591091","status":"affected","versionType":"git"},{"version":"4318608dc28ef184158b4045896740716bea23f0","status":"affected","versionType":"git"},{"version":"7d0567842b78390dd9b60f00f1d8f838d540e325","status":"affected","versionType":"git"},{"version":"e09cbe017311508c21e0739e97198a8388b98981","status":"affected","versionType":"git"},{"version":"6.6.26","status":"affected","lessThan":"6.6.163","versionType":"semver"},{"version":"5.4.285","status":"affected","lessThan":"5.5","versionType":"semver"},{"version":"5.10.227","status":"affected","lessThan":"5.11","versionType":"semver"},{"version":"5.15.168","status":"affected","lessThan":"5.16","versionType":"semver"},{"version":"6.1.85","status":"affected","lessThan":"6.2","versionType":"semver"},{"version":"6.8.5","status":"affected","lessThan":"6.9","versionType":"semver"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/ipv4/inet_fragment.c","net/ipv4/ip_fragment.c","net/ipv6/netfilter/nf_conntrack_reasm.c","net/ipv6/reassembly.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.9","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.9","versionType":"semver"},{"version":"6.6.163","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.119","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.65","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.6","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/ipv4/inet_fragment.c","net/ipv4/ip_fragment.c","net/ipv6/netfilter/nf_conntrack_reasm.c","net/ipv6/reassembly.c"]}],"references":["https://git.kernel.org/stable/c/2970a56311e4b26e12acdc9c53887243283e8b02","https://git.kernel.org/stable/c/6ee928d489fae99aa2108dff346b5afa142b9d3d","https://git.kernel.org/stable/c/dad6663a5dbf5f23c5921f0e2d0709560d388fa6","https://git.kernel.org/stable/c/38f0414192e7ed0a7f250a64d5dfacd6d6139098","https://git.kernel.org/stable/c/b71c101bbb9814d163c00234d43c41f0a17907d4"],"weaknesses":[],"ingestedAt":"2026-11-30T13:56:04.579Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139793.json","commit":"8c2c22940a0de21d18737df980299c0488d5dc73","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139793","state":"PUBLISHED","datePublished":"2026-11-30T13:38:03.174Z","dateUpdated":"2026-11-30T13:38:03.174Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.953Z"},"containers":{"cna":{"title":"inet: frags: bound the wmem charge of the socket completing a reassembly","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\ninet: frags: bound the wmem charge of the socket completing a reassembly\n\nWhen a socket owned fragment completes a reassembly queue,\ninet_frag_reasm_prepare() and inet_frag_reasm_finish() charge the\ntruesize of all other fragments to its sk_wmem_alloc. These fragments\nwere orphaned when queued, and might have been sent by someone else,\nfor instance padded TUN packets.\n\nCommit 3ae20e4697eb (\"inet: frags: limit the truesize of a reassembly\nqueue\") bounds this charge to INT_MAX / 2 per queue, but a socket can\ncomplete several queues while the reassembled skbs are still alive,\nfor instance held in a qdisc. sk_wmem_alloc can then go past INT_MAX,\nrefcount_add() saturates it with a WARN, and the socket is leaked.\n\nThis is reachable from an unprivileged user/network namespace, by\nraising ipfrag_high_thresh.\n\nRefuse the reassembly if the charge would push sk_wmem_alloc above\n2 * sk_sndbuf, the bound ip_append_data() uses, plus 4MB of slack for\nfragments inflated by a refragmentation with a small MTU, and never\nabove INT_MAX / 2. The cap matters for tun sockets, which use\nsk_sndbuf = INT_MAX, and whose skbs are still owned when act_ct or\nopenvswitch reassemble them at ingress.\n\nSeveral queues can complete at the same time on different cpus for\nthe same socket, so the charge is reserved with a cmpxchg() loop in\ninet_frag_reasm_prepare(), before it modifies the queue, and settled\nin inet_frag_reasm_finish(). Move the size checks of ip_frag_reasm(),\nip6_frag_reasm() and nf_ct_frag6_reasm() before\ninet_frag_reasm_prepare(), using the first fragment which becomes the\nhead, so that a successful inet_frag_reasm_prepare() is always followed\nby inet_frag_reasm_finish(). All callers already kill the queue when\ninet_frag_reasm_prepare() returns NULL.\n\nFound by code inspection (AI review), not reproduced."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"f4877225313d474659ee53150ccc3d553a978727","status":"affected","lessThan":"2970a56311e4b26e12acdc9c53887243283e8b02","versionType":"git"},{"version":"18685451fc4e546fc0e718580d32df3c0e5c8272","status":"affected","lessThan":"6ee928d489fae99aa2108dff346b5afa142b9d3d","versionType":"git"},{"version":"18685451fc4e546fc0e718580d32df3c0e5c8272","status":"affected","lessThan":"dad6663a5dbf5f23c5921f0e2d0709560d388fa6","versionType":"git"},{"version":"18685451fc4e546fc0e718580d32df3c0e5c8272","status":"affected","lessThan":"38f0414192e7ed0a7f250a64d5dfacd6d6139098","versionType":"git"},{"version":"18685451fc4e546fc0e718580d32df3c0e5c8272","status":"affected","lessThan":"b71c101bbb9814d163c00234d43c41f0a17907d4","versionType":"git"},{"version":"1b6de5e6575b56502665c65cf93b0ae6aa0f51ab","status":"affected","versionType":"git"},{"version":"9705f447bf9a6cd088300ad2c407b5e1c6591091","status":"affected","versionType":"git"},{"version":"4318608dc28ef184158b4045896740716bea23f0","status":"affected","versionType":"git"},{"version":"7d0567842b78390dd9b60f00f1d8f838d540e325","status":"affected","versionType":"git"},{"version":"e09cbe017311508c21e0739e97198a8388b98981","status":"affected","versionType":"git"},{"version":"6.6.26","status":"affected","lessThan":"6.6.163","versionType":"semver"},{"version":"5.4.285","status":"affected","lessThan":"5.5","versionType":"semver"},{"version":"5.10.227","status":"affected","lessThan":"5.11","versionType":"semver"},{"version":"5.15.168","status":"affected","lessThan":"5.16","versionType":"semver"},{"version":"6.1.85","status":"affected","lessThan":"6.2","versionType":"semver"},{"version":"6.8.5","status":"affected","lessThan":"6.9","versionType":"semver"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/ipv4/inet_fragment.c","net/ipv4/ip_fragment.c","net/ipv6/netfilter/nf_conntrack_reasm.c","net/ipv6/reassembly.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.9","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.9","versionType":"semver"},{"version":"6.6.163","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.119","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.65","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.6","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/ipv4/inet_fragment.c","net/ipv4/ip_fragment.c","net/ipv6/netfilter/nf_conntrack_reasm.c","net/ipv6/reassembly.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/2970a56311e4b26e12acdc9c53887243283e8b02"},{"url":"https://git.kernel.org/stable/c/6ee928d489fae99aa2108dff346b5afa142b9d3d"},{"url":"https://git.kernel.org/stable/c/dad6663a5dbf5f23c5921f0e2d0709560d388fa6"},{"url":"https://git.kernel.org/stable/c/38f0414192e7ed0a7f250a64d5dfacd6d6139098"},{"url":"https://git.kernel.org/stable/c/b71c101bbb9814d163c00234d43c41f0a17907d4"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:38:03.174Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.6.26","versionEndExcluding":"6.6.163"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.9","versionEndExcluding":"6.12.119"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.9","versionEndExcluding":"6.18.65"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.9","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.9","versionEndExcluding":"7.4-rc3"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.4.285"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.10.227"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15.168"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.1.85"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.8.5"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}