Skip to content
OpenAdvisories
Unscored CVE-2024-57974 EUVD-2025-5275GHSA-hqjf-7m9j-v4qc

udp: Deal with race between UDP socket address change and rehash

Published Feb 27, 2025 · Updated Nov 5, 2026 · Assigned by Linux

Vendor: Linux Product: Linux Package: kernel Package: linux Package: linux Package: linux-allwinner-5.19 Package: linux-aws Package: linux-aws-5.0 Package: linux-aws-5.11 Package: linux-aws-5.13 Package: linux-aws-5.15 Package: linux-aws-5.19 Package: linux-aws-5.3 Package: linux-aws-5.4 Package: linux-aws-5.8 Package: linux-aws-6.2 Package: linux-aws-6.5 Package: linux-aws-6.8 Package: linux-aws-fips Package: linux-aws-hwe Package: linux-azure Package: linux-azure-4.15 Package: linux-azure-5.11 Package: linux-azure-5.13 Package: linux-azure-5.15 Package: linux-azure-5.19 Package: linux-azure-5.3 Package: linux-azure-5.4 Package: linux-azure-5.8 Package: linux-azure-6.11 Package: linux-azure-6.2 Package: linux-azure-6.5 Package: linux-azure-6.8 Package: linux-azure-edge Package: linux-azure-fde Package: linux-azure-fde-5.15 Package: linux-azure-fde-5.19 Package: linux-azure-fde-6.2 Package: linux-azure-fips Package: linux-azure-nvidia Package: linux-bluefield Package: linux-fips Package: linux-gcp Package: linux-gcp-4.15 Package: linux-gcp-5.11 Package: linux-gcp-5.13 Package: linux-gcp-5.15 Package: linux-gcp-5.19 Package: linux-gcp-5.3 Package: linux-gcp-5.4 Package: linux-gcp-5.8 Package: linux-gcp-6.11 Package: linux-gcp-6.2 Package: linux-gcp-6.5 Package: linux-gcp-6.8 Package: linux-gcp-fips Package: linux-gke Package: linux-gke-4.15 Package: linux-gke-5.15 Package: linux-gke-5.4 Package: linux-gkeop Package: linux-gkeop-5.15 Package: linux-gkeop-5.4 Package: linux-hwe Package: linux-hwe-5.11 Package: linux-hwe-5.13 Package: linux-hwe-5.15 Package: linux-hwe-5.19 Package: linux-hwe-5.4 Package: linux-hwe-5.8 Package: linux-hwe-6.11 Package: linux-hwe-6.2 Package: linux-hwe-6.5 Package: linux-hwe-6.8 Package: linux-hwe-edge Package: linux-ibm Package: linux-ibm-5.15 Package: linux-ibm-5.4 Package: linux-ibm-6.8 Package: linux-intel-5.13 Package: linux-intel-iot-realtime Package: linux-intel-iotg Package: linux-intel-iotg-5.15 Package: linux-iot Package: linux-kvm Package: linux-lowlatency Package: linux-lowlatency-hwe-5.15 Package: linux-lowlatency-hwe-5.19 Package: linux-lowlatency-hwe-6.11 Package: linux-lowlatency-hwe-6.2 Package: linux-lowlatency-hwe-6.5 Package: linux-lowlatency-hwe-6.8 Package: linux-lts-xenial Package: linux-nvidia Package: linux-nvidia-6.11 Package: linux-nvidia-6.2 Package: linux-nvidia-6.5 Package: linux-nvidia-6.8 Package: linux-nvidia-lowlatency Package: linux-nvidia-tegra Package: linux-nvidia-tegra-5.15 Package: linux-nvidia-tegra-igx Package: linux-oem Package: linux-oem-5.10 Package: linux-oem-5.13 Package: linux-oem-5.14 Package: linux-oem-5.17 Package: linux-oem-5.6 Package: linux-oem-6.0 Package: linux-oem-6.1 Package: linux-oem-6.11 Package: linux-oem-6.5 Package: linux-oem-6.8 Package: linux-oracle Package: linux-oracle-5.0 Package: linux-oracle-5.11 Package: linux-oracle-5.13 Package: linux-oracle-5.15 Package: linux-oracle-5.3 Package: linux-oracle-5.4 Package: linux-oracle-5.8 Package: linux-oracle-6.5 Package: linux-oracle-6.8 Package: linux-raspi Package: linux-raspi-5.4 Package: linux-raspi-realtime Package: linux-raspi2 Package: linux-realtime Package: linux-realtime-6.8 Package: linux-riscv Package: linux-riscv-5.11 Package: linux-riscv-5.15 Package: linux-riscv-5.19 Package: linux-riscv-5.8 Package: linux-riscv-6.5 Package: linux-riscv-6.8 Package: linux-starfive-5.19 Package: linux-starfive-6.2 Package: linux-starfive-6.5 Package: linux-vmware Package: linux-xilinx Package: linux-xilinx-zynqmp Platform: Linux Ecosystem: Azure Linux Ecosystem: Debian Ecosystem: Ubuntu

Description

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---

Affected products

VendorProductAffectedFixed
Linux Linux 2.6.33 6.1.191

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 linux 6.12.13-1 —
Debian 13 linux 6.12.13-1 —
Debian 12 linux No fix yet —
ReleasePackageFixed inAdvisory
Ubuntu Nvidia-BlueField 22.04 LTS linux-bluefield No fix yet —
Ubuntu 24.04 LTS linux 6.8.0-64.67 USN-7651-1
Ubuntu 24.04 LTS linux-aws 6.8.0-1032.34 USN-7651-1
Ubuntu 24.04 LTS linux-azure 6.8.0-1034.39 USN-7737-1
Ubuntu 24.04 LTS linux-azure-nvidia 6.8.0-1022.23 USN-7737-1
Ubuntu 24.04 LTS linux-gcp 6.8.0-1033.35 USN-7651-4
Ubuntu 24.04 LTS linux-gcp-6.11 +1 6.11.0-1015.15~24.04.1 USN-7521-1
Ubuntu 24.04 LTS linux-gke 6.8.0-1028.32 USN-7651-3
Ubuntu 24.04 LTS linux-gkeop 6.8.0-1015.17 USN-7651-3
Ubuntu 24.04 LTS linux-hwe-6.11 6.11.0-26.26~24.04.1 USN-7521-1
Ubuntu 24.04 LTS linux-ibm 6.8.0-1029.29 USN-7651-2
Ubuntu 24.04 LTS linux-lowlatency 6.8.0-64.67.1 USN-7651-2
Ubuntu 24.04 LTS linux-lowlatency-hwe-6.11 6.11.0-1014.15~24.04.1 USN-7521-3
Ubuntu 24.04 LTS linux-nvidia 6.8.0-1031.34 USN-7651-3
Ubuntu 24.04 LTS linux-nvidia-6.11 6.11.0-1010.10 —
Ubuntu 24.04 LTS linux-nvidia-lowlatency 6.8.0-1031.34.1 USN-7651-3
Ubuntu 24.04 LTS linux-nvidia-tegra 6.8.0-1008.8 —
Ubuntu 24.04 LTS linux-oem-6.11 6.11.0-1022.22 USN-7521-1
Ubuntu 24.04 LTS linux-oem-6.8 6.8.0-1031.31 USN-7651-1
Ubuntu 24.04 LTS linux-oracle 6.8.0-1029.30 USN-7651-3
Ubuntu 24.04 LTS linux-raspi 6.8.0-1031.35 USN-7651-6
Ubuntu 24.04 LTS linux-riscv +2 No fix yet —
Ubuntu 24.04 LTS linux-xilinx 6.8.0-1017.18 —
Ubuntu 22.04 LTS linux +49 No fix yet —
Ubuntu 22.04 LTS linux-aws-6.8 6.8.0-1032.34~22.04.1 USN-7651-3
Ubuntu 22.04 LTS linux-azure-6.8 6.8.0-1034.39~22.04.1 USN-7737-1
Ubuntu 22.04 LTS linux-gcp-6.8 6.8.0-1033.35~22.04.1 USN-7651-4
Ubuntu 22.04 LTS linux-hwe-6.8 +1 6.8.0-64.67~22.04.1 USN-7653-1
Ubuntu 22.04 LTS linux-ibm-6.8 6.8.0-1029.29~22.04.1 USN-7651-2
Ubuntu 22.04 LTS linux-lowlatency-hwe-6.8 6.8.0-64.67.1~22.04.1 USN-7651-2
Ubuntu 22.04 LTS linux-nvidia-6.8 6.8.0-1031.34~22.04.1 USN-7651-3
Ubuntu 22.04 LTS linux-oracle-6.8 6.8.0-1029.30~22.04.1 USN-7651-3
Ubuntu 20.04 LTS linux-gke +28 No fix yet —
Ubuntu 18.04 LTS linux-gcp +14 No fix yet —
Show 16 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu 16.04 LTS linux-hwe-edge No fix yet —
Ubuntu Pro Realtime 24.04 LTS linux-raspi-realtime 6.8.0-2026.27 USN-7651-5
Ubuntu Pro Realtime 24.04 LTS linux-realtime 6.8.1-1025.26 USN-7652-1
Ubuntu Pro Realtime 22.04 LTS linux-realtime +1 No fix yet —
Ubuntu Pro Realtime 22.04 LTS linux-realtime-6.8 6.8.1-1025.26~22.04.1 —
Ubuntu Pro FIPS 20.04 LTS linux-fips +3 No fix yet —
Ubuntu Pro FIPS 18.04 LTS linux-fips +3 No fix yet —
Ubuntu Pro FIPS 16.04 LTS linux-fips No fix yet —
Ubuntu Pro FIPS-updates 24.04 LTS linux-fips 6.8.0-78.78+fips1 —
Ubuntu Pro FIPS-updates 22.04 LTS linux-fips +3 No fix yet —
Ubuntu Pro FIPS-updates 20.04 LTS linux-fips +3 No fix yet —
Ubuntu Pro FIPS-updates 18.04 LTS linux-fips +3 No fix yet —
Ubuntu Pro FIPS-updates 16.04 LTS linux-fips No fix yet —
Ubuntu Pro FIPS-preview 22.04 LTS linux-fips +3 No fix yet —
Ubuntu Pro 20.04 LTS linux +21 No fix yet —
Ubuntu Pro 18.04 LTS linux +12 No fix yet —
Ubuntu Pro 16.04 LTS linux +7 No fix yet —
Ubuntu Pro 14.04 LTS linux +3 No fix yet —
ReleasePackageFixed inAdvisory
RHEL 9 rv +75 5.14.0-687.61.1.el9_8 RHSA-2026:90365

AlmaLinux

Errata ↗
ReleasePackageFixed inAdvisory
AlmaLinux 9 rv +73 5.14.0-687.61.1.el9_8 ALSA-2026:90365

Rocky Linux

Errata ↗
ReleasePackageFixed inAdvisory
Rocky Linux 9 kernel 5.14.0-687.61.1.el9_8 RXSA-2026:90365, RLSA-2026:90365
ReleasePackageFixed inAdvisory
SLES 15 SP7 kernel-64kb +6 6.4.0-150700.53.3.1 SUSE-SU-2025:01951-1
SLES 15 SP7 kernel-azure +2 6.4.0-150700.20.3.1 SUSE-SU-2025:01967-1
SLES 15 SP7 kernel-default-base 6.4.0-150700.53.3.1.150700.17.2.1 SUSE-SU-2025:01951-1
SLES 15 SP6 kernel-64kb +3 6.4.0-150600.23.47.2 SUSE-SU-2025:1180-1
SLES 15 SP6 kernel-azure +1 6.4.0-150600.8.34.2 SUSE-SU-2025:1177-1
SLES 15 SP6 kernel-coco +3 6.4.0-15061.21.coco15sp6.1 SUSE-SU-2025:01919-1
SLES 15 SP6 kernel-default-base 6.4.0-150600.23.47.2.150600.12.20.2 SUSE-SU-2025:1180-1
SLES 15 SP6 kernel-docs +2 6.4.0-150600.23.47.1 SUSE-SU-2025:1180-1
SLES 15 SP6 kernel-syms-azure 6.4.0-150600.8.34.1 SUSE-SU-2025:1177-1
Show 5 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SLE Micro 6.1 kernel-default-base 6.4.0-28.1.21.6 SUSE-SU-2025:20270-1
SLE Micro 6.1 kernel-livepatch-MICRO-6-0_Update_6 +1 1-3.1 SUSE-SU-2025:20270-1, SUSE-SU-2025:20260-1
SLE Micro 6.1 kernel-rt +4 6.4.0-28.1 SUSE-SU-2025:20270-1, SUSE-SU-2025:20260-1
SLE Micro 6.0 kernel-default-base 6.4.0-28.1.21.6 SUSE-SU-2025:20192-1
SLE Micro 6.0 kernel-livepatch-MICRO-6-0_Update_6 +1 1-3.1 SUSE-SU-2025:20192-1, SUSE-SU-2025:20190-1
SLE Micro 6.0 kernel-rt +4 6.4.0-28.1 SUSE-SU-2025:20192-1, SUSE-SU-2025:20190-1
SLE Live Patching 15 SP7 kernel-default 6.4.0-150700.53.3.1 SUSE-SU-2025:01951-1
SLE Live Patching 15 SP7 kernel-livepatch-SLE15-SP7_Update_1 1-150700.15.3.1 SUSE-SU-2025:01951-1
SLE Live Patching 15 SP6 kernel-default 6.4.0-150600.23.47.2 SUSE-SU-2025:1180-1
SLE Live Patching 15 SP6 kernel-livepatch-SLE15-SP6-RT_Update_10 1-150600.1.5.1 SUSE-SU-2025:1178-1
SLE Live Patching 15 SP6 kernel-livepatch-SLE15-SP6_Update_10 1-150600.13.5.1 SUSE-SU-2025:1180-1
SUSE Real Time Module 15 SP6 kernel-rt +3 6.4.0-150600.10.34.1 SUSE-SU-2025:1178-1
ReleasePackageFixed inAdvisory
openSUSE Leap 15.6 dtb-aarch64 +4 6.4.0-150600.23.47.1 SUSE-SU-2025:1180-1
openSUSE Leap 15.6 kernel-64kb +5 6.4.0-150600.23.47.2 SUSE-SU-2025:1180-1
openSUSE Leap 15.6 kernel-azure +1 6.4.0-150600.8.34.2 SUSE-SU-2025:1177-1
openSUSE Leap 15.6 kernel-default-base 6.4.0-150600.23.47.2.150600.12.20.2 SUSE-SU-2025:1180-1
openSUSE Leap 15.6 kernel-rt +3 6.4.0-150600.10.34.1 SUSE-SU-2025:1178-1
openSUSE Leap 15.6 kernel-syms-azure 6.4.0-150600.8.34.1 SUSE-SU-2025:1177-1

Azure Linux

ReleasePackageFixed inAdvisory
Azure Linux 3 kernel No fix yet —
Azure Linux 2 (CBL-Mariner) kernel No fix yet —

Oracle Linux

ReleasePackageFixed inAdvisory
Oracle Linux 9 kernel-uek +34 6.12.0-101.33.4.3.el10uek ELSA-2025-20530, ELSA-2025-20480
Oracle Linux 9 rv +28 5.14.0-687.61.1.el9_8 ELSA-2026-90365

Advisories 30

References