CVE-2024-57974 json
udp: Deal with race between UDP socket address change and rehash
published 2025-02-27 20 mo ago modified 2026-11-05 3 d ago also EUVD-2025-5275
- cvss
- 4.7
- version 3.1, NVD
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.2%
- EPSS 0.2% chance of exploitation in 30 days, percentile 7%
- public exploits
- 0
- none known
Summary
In the Linux kernel, the following vulnerability has been resolved:
udp: Deal with race between UDP socket address change and rehash
If a UDP socket changes its local address while it's receiving datagrams, as a result of connect(), there is a period during which a lookup operation might fail to find it, after the address is changed but before the secondary hash (port and address) and the four-tuple hash (local and remote ports and addresses) are updated.
Secondary hash chains were introduced by commit 30fff9231fad ("udp: bind() optimisation") and, as a result, a rehash operation became needed to make a bound socket reachable again after a connect().
This operation was introduced by commit 719f835853a9 ("udp: add rehash on connect()") which isn't however a complete fix: the socket will be found once the rehashing completes, but not while it's pending.
This is noticeable with a socat(1) server in UDP4-LISTEN mode, and a client sending datagrams to it. After the server receives the first datagram (cf. _xioopen_ipdgram_listen()), it issues a connect() to the address of the sender, in order to set up a directed flow.
Now, if the client, running on a different CPU thread, happens to send a (subsequent) datagram while the server's socket changes its address, but is not rehashed yet, this will result in a failed lookup and a port unreachable error delivered to the client, as apparent from the following reproducer:
LEN=$(($(cat /proc/sys/net/core/wmem_default) / 4)) dd if=/dev/urandom bs=1 count=${LEN} of=tmp.in
while :; do taskset -c 1 socat UDP4-LISTEN:1337,null-eof OPEN:tmp.out,create,trunc & sleep 0.1 || sleep 1 taskset -c 2 socat OPEN:tmp.in UDP4:localhost:1337,shut-null wait done
where the client will eventually get ECONNREFUSED on a write() (typically the second or third one of a given iteration):
2024/11/13 21:28:23 socat[46901] E write(6, 0x556db2e3c000, 8192): Connection refused
This issue was first observed as a seldom failure in Podman's tests checking UDP functionality while using pasta(1) to connect the container's network namespace, which leads us to a reproducer with the lookup error resulting in an ICMP packet on a tap device:
LOCAL_ADDR="$(ip -j -4 addr show|jq -rM '.[] | .addr_info[0] | select(.scope == "global").local')"
while :; do ./pasta --config-net -p pasta.pcap -u 1337 socat UDP4-LISTEN:1337,null-eof OPEN:tmp.out,create,trunc & sleep 0.2 || sleep 1 socat OPEN:tmp.in UDP4:${LOCAL_ADDR}:1337,shut-null wait cmp tmp.in tmp.out done
Once this fails:
tmp.in tmp.out differ: char 8193, line 29
we can finally have a look at what's going on:
$ tshark -r pasta.pcap 1 0.000000 :: ? ff02::16 ICMPv6 110 Multicast Listener Report Message v2 2 0.168690 88.198.0.161 ? 88.198.0.164 UDP 8234 60260 ? 1337 Len=8192 3 0.168767 88.198.0.161 ? 88.198.0.164 UDP 8234 60260 ? 1337 Len=8192 4 0.168806 88.198.0.161 ? 88.198.0.164 UDP 8234 60260 ? 1337 Len=8192 5 0.168827 c6:47:05:8d:dc:04 ? Broadcast ARP 42 Who has 88.198.0.161? Tell 88.198.0.164 6 0.168851 9a:55:9a:55:9a:55 ? c6:47:05:8d:dc:04 ARP 42 88.198.0.161 is at 9a:55:9a:55:9a:55 7 0.168875 88.198.0.161 ? 88.198.0.164 UDP 8234 60260 ? 1337 Len=8192 8 0.168896 88.198.0.164 ? 88.198.0.161 ICMP 590 Destination unreachable (Port unreachable) 9 0.168926 88.198.0.161 ? 88.198.0.164 UDP 8234 60260 ? 1337 Len=8192 10 0.168959 88.198.0.161 ? 88.198.0.164 UDP 8234 60260 ? 1337 Len=8192 11 0.168989 88.198.0.161 ? 88.198.0.164 UDP 4138 60260 ? 1337 Len=4096 12 0.169010 88.198.0.161 ? 88.198.0.164 UDP 42 60260 ? 1337 Len=0
On the third datagram received, the network namespace of the container initiates an ARP lookup to deliver the ICMP message.
In another variant of this reproducer, starting the client with:
strace -f pasta --config-net -u 1337 socat UDP4-LISTEN:1337,null-eof OPEN:tmp.out,create,tru ---truncated---
Patch / fix
- Linux Linux 6.1.191, 6.6.160, 6.12.13, 6.13.2, 6.14
- linux Debian 14, Debian 13 6.12.13-1
debian advisories DEBIAN-CVE-2024-57974
- linux Ubuntu 24.04 LTS 6.8.0-64.67
- linux-aws Ubuntu 24.04 LTS 6.8.0-1032.34
- linux-gcp Ubuntu 24.04 LTS 6.8.0-1033.35
- linux-gke Ubuntu 24.04 LTS 6.8.0-1028.32
- linux-ibm Ubuntu 24.04 LTS 6.8.0-1029.29
- linux-azure Ubuntu 24.04 LTS 6.8.0-1034.39
- linux-gkeop Ubuntu 24.04 LTS 6.8.0-1015.17
- linux-raspi Ubuntu 24.04 LTS 6.8.0-1031.35
ubuntu advisories UBUNTU-CVE-2024-57974
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- kernel-azure SLE Module for Public Cloud 15 SP7 6.4.0-150700.20.3.1
- kernel-syms-azure SLE Module for Public Cloud 15 SP7 6.4.0-150700.20.3.1
- kernel-source-azure SLE Module for Public Cloud 15 SP7 6.4.0-150700.20.3.1
- kernel-64kb SLE Module for Basesystem 15 SP7 6.4.0-150700.53.3.1
- kernel-syms SLE Module for Development Tools 15 SP7 6.4.0-150700.53.3.1
- kernel-source SLE Module for Development Tools 15 SP7, SLE Module for Basesystem 15 SP7 6.4.0-150700.53.3.1
- kernel-default SLE Workstation Extension 15 SP7, SLE Module for Legacy 15 SP7, SLE Module for Basesystem 15 SP7 +2 more 6.4.0-150700.53.3.1
- kernel-zfcpdump SLE Module for Basesystem 15 SP7 6.4.0-150700.53.3.1
suse advisories SUSE-SU-2025:01967-1SUSE-SU-2025:01951-1SUSE-SU-2025:01919-1SUSE-SU-2025:20192-1SUSE-SU-2025:20270-1SUSE-SU-2025:20190-1
- kernel AlmaLinux 9 5.14.0-687.61.1.el9_8
- rv AlmaLinux 9 5.14.0-687.61.1.el9_8
- perf AlmaLinux 9 5.14.0-687.61.1.el9_8
- rtla AlmaLinux 9 5.14.0-687.61.1.el9_8
- libperf AlmaLinux 9 5.14.0-687.61.1.el9_8
- kernel-rt AlmaLinux 9 5.14.0-687.61.1.el9_8
- kernel-64k AlmaLinux 9 5.14.0-687.61.1.el9_8
- kernel-core AlmaLinux 9 5.14.0-687.61.1.el9_8
almalinux advisories ALSA-2026:90365
- kernel Rocky Linux 9 5.14.0-687.61.1.el9_8.cloud.1.0
- kernel Rocky Linux 9 5.14.0-687.61.1.el9_8
rocky linux advisories RXSA-2026:90365RLSA-2026:90365
- git.kernel.org/stable/c/3946283de7bbb76b2995bd51ab0388d4fd556c77 commit
- git.kernel.org/stable/c/2855445a1870b8e568fb19edbd60b9c499e3dae0 commit
- git.kernel.org/stable/c/4f8344fce91c5766d368edb0ad80142eacd805c7 commit
- git.kernel.org/stable/c/d65d3bf309b2649d27b24efd0d8784da2d81f2a6 commit
- git.kernel.org/stable/c/a502ea6fa94b1f7be72a24bcf9e3f5f6b7e6e90c commit
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2024-57974 updated cvss 4.7
kernel: udp: Deal with race between UDP socket address change and rehash
-
Red Hat Enterprise Linux 6 perf, kernel, python-perf, kernel-kdump, kernel-firmware, kernel-bootwrapper, +1 more Red Hat Enterprise Linux 7 perf, kernel, bpftool, kernel-rt, python-perf, kernel-kdump, +8 more Red Hat Enterprise Linux 8 perf, kernel, bpftool, kernel-rt, kernel-core, kernel-tools, +29 moreaffected: no fix planned “Out of support scope”
-
Red Hat Enterprise Linux 9 kernel-rt, kernel-rt-kvm, kernel-rt-core, kernel-rt-modules, kernel-rt-debug-kvm, kernel-rt-debug-core, +12 moreaffected: no fix available “Fix deferred”
-
Red Hat Enterprise Linux 10 kernelaffected: no fix available
-
Red Hat Enterprise Linux AppStream (v. 9) rv 5.14.0-687.61.1.el9_8, perf 5.14.0-687.61.1.el9_8, rtla 5.14.0-687.61.1.el9_8, python3-perf 5.14.0-687.61.1.el9_8, kernel-devel-matched 5.14.0-687.61.1.el9_8, kernel-64k-devel-matched 5.14.0-687.61.1.el9_8, +7 more Red Hat Enterprise Linux BaseOS (v. 9) kernel 5.14.0-687.61.1.el9_8, kernel-64k 5.14.0-687.61.1.el9_8, kernel-core 5.14.0-687.61.1.el9_8, kernel-tools 5.14.0-687.61.1.el9_8, kernel-modules 5.14.0-687.61.1.el9_8, kernel-64k-core 5.14.0-687.61.1.el9_8, +27 more Red Hat Enterprise Linux CodeReady Linux Builder (v. 9) libperf 5.14.0-687.61.1.el9_8, kernel-debuginfo-common-s390x 5.14.0-687.61.1.el9_8, kernel-debuginfo-common-x86_64 5.14.0-687.61.1.el9_8, kernel-debuginfo-common-aarch64 5.14.0-687.61.1.el9_8, kernel-debuginfo-common-ppc64le 5.14.0-687.61.1.el9_8 Red Hat Enterprise Linux Real Time (v. 9) kernel-rt 5.14.0-687.61.1.el9_8, kernel-rt-64k 5.14.0-687.61.1.el9_8, kernel-rt-core 5.14.0-687.61.1.el9_8, kernel-rt-modules 5.14.0-687.61.1.el9_8, kernel-rt-64k-core 5.14.0-687.61.1.el9_8, kernel-rt-debug-core 5.14.0-687.61.1.el9_8, +14 more Red Hat Enterprise Linux Real Time for NFV (v. 9) kernel-rt 5.14.0-687.61.1.el9_8, kernel-rt-core 5.14.0-687.61.1.el9_8, kernel-rt-modules 5.14.0-687.61.1.el9_8, kernel-rt-debug-core 5.14.0-687.61.1.el9_8, kernel-rt-modules-core 5.14.0-687.61.1.el9_8, kernel-rt-debug-modules 5.14.0-687.61.1.el9_8, +4 morefixed: vendor fix RHSA-2026:90365
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
- Assessed
- 3 d ago
Exploit prediction
0.18% chance of exploitation in the next 30 days, higher than 7% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| NVD | 3.1 | 4.7 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H |
Affected products
- Linux Linux
Classification
- Weakness
-
- CWE-362 Concurrent Execution using Shared Resource with Improper Synchronization
- Technology feeds
References
- git.kernel.org /stable/c/3946283de7bbb76b2995bd51ab0388d4fd556c77
- git.kernel.org /stable/c/2855445a1870b8e568fb19edbd60b9c499e3dae0
-
git.kernel.org
/stable/c/4f8344fce91c5766d368edb0ad80142eacd805c7
patch
-
git.kernel.org
/stable/c/d65d3bf309b2649d27b24efd0d8784da2d81f2a6
patch
-
git.kernel.org
/stable/c/a502ea6fa94b1f7be72a24bcf9e3f5f6b7e6e90c
patch
Sources
- CVE List CVE-2024-57974
- NVD CVE-2024-57974
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.