CVE-2025-22059: udp: Fix multiple wraparounds of sk->sk_rmem_alloc.
In the Linux kernel, the following vulnerability has been resolved:
udp: Fix multiple wraparounds of sk->sk_rmem_alloc.
__udp_enqueue_schedule_skb() has the following condition:
if (atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf)
goto drop;
sk->sk_rcvbuf is initialised by net.core.rmem_default and later can
be configured by SO_RCVBUF, which is limited by net.core.rmem_max,
or SO_RCVBUFFORCE.
If we set INT_MAX to sk->sk_rcvbuf, the condition is always false
as sk->sk_rmem_alloc is also signed int.
Then, the size of the incoming skb is added to sk->sk_rmem_alloc
unconditionally.
This results in integer overflow (possibly multiple times) on
sk->sk_rmem_alloc and allows a single socket to have skb up to
net.core.udp_mem[1].
For example, if we set a large value to udp_mem[1] and INT_MAX to
sk->sk_rcvbuf and flood packets to the socket, we can see multiple
overflows:
# cat /proc/net/sockstat | grep UDP:
UDP: inuse 3 mem 7956736 <-- (7956736 << 12) bytes > INT_MAX * 15
^- PAGE_SHIFT
# ss -uam
State Recv-Q ...
UNCONN -1757018048 ... <-- flipping the sign repeatedly
skmem:(r2537949248,rb2147483646,t0,tb212992,f1984,w0,o0,bl0,d0)
Previously, we had a boundary check for INT_MAX, which was removed by
commit 6a1f12dd85a8 ("udp: relax atomic operation on sk->sk_rmem_alloc").
A complete fix would be to revert it and cap the right operand by
INT_MAX:
rmem = atomic_add_return(size, &sk->sk_rmem_alloc);
if (rmem > min(size + (unsigned int)sk->sk_rcvbuf, INT_MAX))
goto uncharge_drop;
but we do not want to add the expensive atomic_add_return() back just
for the corner case.
Casting rmem to unsigned int prevents multiple wraparounds, but we still
allow a single wraparound.
# cat /proc/net/sockstat | grep UDP:
UDP: inuse 3 mem 524288 <-- (INT_MAX + 1) >> 12
# ss -uam
State Recv-Q ...
UNCONN -2147482816 ... <-- INT_MAX + 831 bytes
skmem:(r2147484480,rb2147483646,t0,tb212992,f3264,w0,o0,bl0,d14468947)
So, let's define rmem and rcvbuf as unsigned int and check skb->truesize
only when rcvbuf is large enough to lower the overflow possibility.
Note that we still have a small chance to see overflow if multiple skbs
to the same socket are processed on different core at the same time and
each size does not exceed the limit but the total size does.
Note also that we must ignore skb->truesize for a small buffer as
explained in commit 363dc73acacb ("udp: be less conservative with
sock rmem accounting").
Security readout for executives and security teams
Plain-English summary
A Linux UDP receive-memory accounting flaw can let one socket consume excessive kernel memory, potentially exhausting resources and disrupting service. The issue is remotely reachable according to the supplied CVSS assessment, but the source description indicates that unusually large receive-buffer and UDP memory settings materially influence practical exposure.
Executive priority
Treat as a high-priority availability risk for internet-facing or operationally critical Linux UDP services. Accelerate patching where large receive buffers or generous UDP memory limits are used. Other systems should follow normal high-severity remediation timelines after version and configuration validation.
Technical view
Signed integer wraparound in sk_rmem_alloc can bypass the UDP receive-buffer limit after incoming packet memory is charged. Repeated wraparounds may permit queued socket buffers up to the configured udp_mem threshold. The correction changes accounting comparisons to unsigned values and adds an overflow-aware size check, although the source notes a small concurrency-related overflow possibility remains.
Likely exposure
Prioritize Linux systems running affected kernels that expose UDP services and permit exceptionally large socket receive buffers or UDP memory limits. The bundle identifies affected releases including 6.10, 6.12.23, 6.13.11, 6.14.2, and 6.15, but does not provide sufficiently clear version-range semantics for definitive fleet matching.
Exploitation context
CVSS 3.1 rates this 7.5: network-accessible, low complexity, no privileges or user interaction, with high availability impact. The bundle does not report confidentiality or integrity impact. It is not listed as KEV, and the provided sources do not establish active exploitation or a public weaponized exploit.
Researcher notes
The vulnerable behavior follows removal of an earlier INT_MAX boundary check in commit 6a1f12dd85a8. The supplied record contains duplicate commit identifiers and ambiguous affected-version entries, including “0”; therefore, downstream vendor package advisories should determine exact exposure. The upstream discussion explicitly acknowledges a residual, low-probability concurrent accounting overflow.
Mitigation direction
Update to a vendor-supported kernel containing the applicable linked stable fix.
Confirm exact affected and corrected package versions through your Linux distribution's security guidance.
Restrict unnecessary externally reachable UDP services until remediation is complete.
Review unusually large receive-buffer and udp_mem settings, preserving documented operational requirements.
Monitor UDP socket memory consumption and host memory pressure for abnormal growth.
Validation and detection
Inventory kernel versions across systems exposing UDP services.
Map distribution kernel packages to the linked upstream stable fixes.
Review receive-buffer, udp_mem, and privileged SO_RCVBUFFORCE usage for elevated exposure.
Check UDP socket statistics for abnormal memory growth or negative receive-queue accounting.
After updating, confirm the running kernel package includes the vendor's correction.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-190: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-190 · source CWE mapping
Integer Overflow or Wraparound
Integer Overflow or Wraparound represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.