CVE-2026-139793

inet: frags: bound the wmem charge of the socket completing a reassembly

Published Nov 30, 2026 CVSS n/a EPSS n/a KEV · Not listed
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.

Analysis

AI-generated

Technical impact

When a socket completes a packet fragment reassembly, the kernel adds the true size of all fragments on that queue to the socket's memory charge, sk_wmem_alloc. The existing limit of INT_MAX/2 per queue can be exceeded when multiple reassembly queues finish concurrently before the reassembled skbs are freed, causing refcount_add() to saturate and the socket to leak. An attacker in an unprivileged user or network namespace can trigger this by raising the ipfrag_high_thresh value. This bug allows an unprivileged actor to consume kernel memory and potentially cause a denial of service. The weakness is a failure to properly limit resource usage (CWE‑400).

Affected Systems

All Linux kernel releases that have not incorporated the patch commit 3ae20e4697eb are vulnerable. The issue can affect any system using tun sockets with maximum sk_sndbuf sizes (INT_MAX) and where fragments may be reassembled by act_ct or Open vSwitch. The vulnerability is independent of operating system distribution and applies to all architectures running the affected kernel code.

Risk and Exploitability

The likelihood of exploitation was not quantified in the available data, with no EPSS score provided and no listing in the CISA KEV catalog. The vulnerability is exploitable from an unprivileged user or network namespace by adjusting ipfrag_high_thresh and sending crafted packets that trigger concurrent reassembly queues. The attack vector is inferred from the description; direct evidence of exploitation was not reproduced, but the code review exposure indicates the condition could be met under realistic networking scenarios. The resulting memory overcharge and socket leak present a significant risk to system stability and availability.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the latest Linux kernel version that includes commit 3ae20e4697eb
  • If immediate patching is not possible, configure ipfrag_high_thresh to a lower, safer value to avoid triggering the reassembly charge overflow
  • Verify that tun sockets are not configured with sk_sndbuf set to INT_MAX when reassembly is active or in containers that can reassemble packets

Generated by OpenCVE AI on December 1, 2026 at 01:45 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-400
Type Values Removed Values Added
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.
Title inet: frags: bound the wmem charge of the socket completing a reassembly
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-400

    Uncontrolled Resource Consumption

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:38 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:20 PM
Modified
Nov 30, 2026, 2:20 PM