CVE & CISA-KEV Catalog

CVE-2025-22059

MEDIUM
5.5
CVSS v3
NVD

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

How to fix

Remediation Available
linuxDebian
Fixed in:6.12.25-1CVE-2025-22059
Fixed in:6.12.25-1CVE-2025-22059
linux-azure-6.11Ubuntu
Fixed in:6.11.0-1018.18~24.04.1USN-7628-1
linux-gcp-6.11Ubuntu
Fixed in:6.11.0-1016.16~24.04.1USN-7605-1
linux-hwe-6.11Ubuntu
Fixed in:6.11.0-28.28~24.04.1USN-7605-1
linux-image-6.11.0-1015-lowlatencyUbuntu
Fixed in:6.11.0-1015.16~24.04.2USN-7605-2
linux-image-6.11.0-1015-lowlatency-64kUbuntu
Fixed in:6.11.0-1015.16~24.04.2USN-7605-2
linux-image-6.11.0-1016-gcpUbuntu
Fixed in:6.11.0-1016.16~24.04.1USN-7605-1
linux-image-6.11.0-1016-gcp-64kUbuntu
Fixed in:6.11.0-1016.16~24.04.1USN-7605-1
linux-image-6.11.0-1018-azureUbuntu
Fixed in:6.11.0-1018.18~24.04.1USN-7628-1
linux-image-6.11.0-1018-azure-fdeUbuntu
Fixed in:6.11.0-1018.18~24.04.1USN-7628-1
linux-image-6.11.0-1024-oemUbuntu
Fixed in:6.11.0-1024.24USN-7606-1
linux-image-6.11.0-28-genericUbuntu
Fixed in:6.11.0-28.28~24.04.1USN-7605-1
linux-image-6.11.0-28-generic-64kUbuntu
Fixed in:6.11.0-28.28~24.04.1USN-7605-1
linux-image-azureUbuntu
Fixed in:6.11.0-1018.18~24.04.1USN-7628-1
linux-image-azure-6.11Ubuntu
Fixed in:6.11.0-1018.18~24.04.1USN-7628-1
linux-image-azure-fdeUbuntu
Fixed in:6.11.0-1018.18~24.04.1USN-7628-1
linux-image-azure-fde-6.11Ubuntu
Fixed in:6.11.0-1018.18~24.04.1USN-7628-1
linux-image-azure-fde-edgeUbuntu
Fixed in:6.11.0-1018.18~24.04.1USN-7628-1
linux-image-gcpUbuntu
Fixed in:6.11.0-1016.16~24.04.1USN-7605-1
linux-image-gcp-64kUbuntu
Fixed in:6.11.0-1016.16~24.04.1USN-7605-1
linux-image-generic-64k-hwe-24.04Ubuntu
Fixed in:6.11.0-28.28~24.04.1USN-7605-1
linux-image-generic-hwe-24.04Ubuntu
Fixed in:6.11.0-28.28~24.04.1USN-7605-1
linux-image-lowlatency-6.11Ubuntu
Fixed in:6.11.0-1015.16~24.04.2USN-7605-2
linux-image-lowlatency-64k-6.11Ubuntu
Fixed in:6.11.0-1015.16~24.04.2USN-7605-2
linux-image-lowlatency-64k-hwe-24.04Ubuntu
Fixed in:6.11.0-1015.16~24.04.2USN-7605-2
linux-image-lowlatency-hwe-24.04Ubuntu
Fixed in:6.11.0-1015.16~24.04.2USN-7605-2
linux-image-oem-24.04bUbuntu
Fixed in:6.11.0-1024.24USN-7606-1
linux-image-virtual-hwe-24.04Ubuntu
Fixed in:6.11.0-28.28~24.04.1USN-7605-1
linux-lowlatency-hwe-6.11Ubuntu
Fixed in:6.11.0-1015.16~24.04.2USN-7605-2
linux-oem-6.11Ubuntu
Fixed in:6.11.0-1024.24USN-7606-1

Remediation is compiled from vendor and distribution security advisories. Always confirm against the linked source for your exact version and platform.

CVSS v3 Vector

Exploitability

Attack VectorLocal
Attack ComplexityLow
Privileges RequiredLow
User InteractionNone
ScopeUnchanged

Impact

ConfidentialityNone
IntegrityNone
AvailabilityHigh

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

Exploit Intelligence

0.17%probability of exploitation in 30 days
6thpercentile

Low risk: more likely to be exploited than 6% of all known CVEs.

References

Related Vulnerabilities

Other CWE-190 (Integer Overflow) vulnerabilities, ordered by exploit likelihood. View all

CVESeverityCVSSEPSSExploitedFix
CVE-2020-16040Medium6.5100%-Fix
CVE-2019-11477High7.599%-Fix
CVE-2023-44443High7.894%-Fix
CVE-2014-0569High9.390%--
CVE-2017-3599High7.590%-Fix
CVE-2023-21716Critical9.882%-Fix
Embed a live status badge for CVE-2025-22059
CVE-2025-22059 severity badge

Markdown

[![CVE-2025-22059](https://tridentstack.com/cve/badge/CVE-2025-22059.svg)](https://tridentstack.com/cve/CVE-2025-22059)

HTML

<a href="https://tridentstack.com/cve/CVE-2025-22059"><img src="https://tridentstack.com/cve/badge/CVE-2025-22059.svg" alt="CVE-2025-22059"></a>

Find and fix vulnerabilities across your fleet

TridentStack Control continuously scans your Windows, macOS, and Linux fleet for known vulnerabilities, prioritizes them by severity and active exploitation, and patches them automatically.

Start free

This product uses NVD data but is not endorsed or certified by the NVD. EPSS scores courtesy of FIRST.org (https://www.first.org/epss). Source: CISA KEV Catalog. Data as of 2025-10-01.