# CVE-2025-22059: udp: Fix multiple wraparounds of sk-\>sk\_rmem\_alloc.

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.5
- **CVSS:** 7.5 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 0.69% (percentile 48, 2026-11-26)
- **CWE:** CWE-190
- **Published:** 2025-04-16T14:12:15.505Z
- **Modified:** 2026-08-05T11:56:26.071Z

## Who should check

- Anyone running Linux \>= 6a1f12dd85a8b24f871dfcf467378660af9c064d, \< 94d5ad7b41122be33ebc2a6830fe710cba1ecd75; \>= 6a1f12dd85a8b24f871dfcf467378660af9c064d, \< 1f529988efe9870db802cb79d01d8f473099b4d7; \>= 6a1f12dd85a8b24f871dfcf467378660af9c064d, \< 7571aadd20289e9ea10ebfed0986f39ed8b3c16b; \>= 6a1f12dd85a8b24f871dfcf467378660af9c064d, \< 5a465a0da13ee9fbd7d3cd0b2893309b0fe4b7e3
- Anyone running Linux 6.10

## Description

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").

## Affected and fixed versions

- Linux: \>= 6a1f12dd85a8b24f871dfcf467378660af9c064d, \< 94d5ad7b41122be33ebc2a6830fe710cba1ecd75; \>= 6a1f12dd85a8b24f871dfcf467378660af9c064d, \< 1f529988efe9870db802cb79d01d8f473099b4d7; \>= 6a1f12dd85a8b24f871dfcf467378660af9c064d, \< 7571aadd20289e9ea10ebfed0986f39ed8b3c16b; \>= 6a1f12dd85a8b24f871dfcf467378660af9c064d, \< 5a465a0da13ee9fbd7d3cd0b2893309b0fe4b7e3 (cvelist)
- Linux: 6.10 (cvelist)

## Mitigation

- Upgrade Linux to 5a465a0da13ee9fbd7d3cd0b2893309b0fe4b7e3 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-22059. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-22059.md
Affected: Linux >= 6a1f12dd85a8b24f871dfcf467378660af9c064d, < 94d5ad7b41122be33ebc2a6830fe710cba1ecd75; >= 6a1f12dd85a8b24f871dfcf467378660af9c064d, < 1f529988efe9870db802cb79d01d8f473099b4d7; >= 6a1f12dd85a8b24f871dfcf467378660af9c064d, < 7571aadd20289e9ea10ebfed0986f39ed8b3c16b; >= 6a1f12dd85a8b24f871dfcf…
Fixed in: Linux 94d5ad7b41122be33ebc2a6830fe710cba1ecd75, Linux 1f529988efe9870db802cb79d01d8f473099b4d7, Linux 7571aadd20289e9ea10ebfed0986f39ed8b3c16b, Linux 5a465a0da13ee9fbd7d3cd0b2893309b0fe4b7e3

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-22059 being exploited?

There is no confirmed exploitation: CVE-2025-22059 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.69% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-22059?

High: CVSS 7.5 (v3.1, scored by CNA). Remote, no login needed.

### Which versions are affected by CVE-2025-22059?

Linux \>= 6a1f12dd85a8b24f871dfcf467378660af9c064d, \< 94d5ad7b41122be33ebc2a6830fe710cba1ecd75; \>= 6a1f12dd85a8b24f871dfcf467378660af9c064d, \< 1f529988efe9870db802cb79d01d8f473099b4d7; \>= 6a1f12dd85a8b24f871dfcf467378660af9c064d, \< 7571aadd20289e9ea10ebfed0986f39ed8b3c16b; \>= 6a1f12dd85a8b24f871dfcf467378660af9c064d, \< 5a465a0da13ee9fbd7d3cd0b2893309b0fe4b7e3; Linux 6.10.

### Is there a fix for CVE-2025-22059?

Yes. Fixed in Linux 94d5ad7b41122be33ebc2a6830fe710cba1ecd75, Linux 1f529988efe9870db802cb79d01d8f473099b4d7, Linux 7571aadd20289e9ea10ebfed0986f39ed8b3c16b, Linux 5a465a0da13ee9fbd7d3cd0b2893309b0fe4b7e3. Upgrade Linux to 5a465a0da13ee9fbd7d3cd0b2893309b0fe4b7e3 or later.

### How do I check if I'm affected by CVE-2025-22059?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/94d5ad7b41122be33ebc2a6830fe710cba1ecd75>
- patch: <https://git.kernel.org/stable/c/1f529988efe9870db802cb79d01d8f473099b4d7>
- patch: <https://git.kernel.org/stable/c/7571aadd20289e9ea10ebfed0986f39ed8b3c16b>
- patch: <https://git.kernel.org/stable/c/5a465a0da13ee9fbd7d3cd0b2893309b0fe4b7e3>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-22059>

HTML: <https://flawdb.com/CVE-2025-22059> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-22059>
