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---
CVSS Details
- CVSS 3.1 Base Score: 4.7
- CVSS 3.1 Vector: (CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H)
Covered by Rapid7
| Product | Vendor Advisory | Solution File | Added | Published |
|---|---|---|---|---|
| Debian | — | No solution existsUpgrade linux | May 15, 2025 | Feb 27, 2025 |
| Huawei Euleros 2_0_sp11 | — | Upgrade kernel-abi-stablelistsUpgrade python3-perfUpgrade kernel-tools-libsUpgrade kernelUpgrade kernel-toolsUpgrade bpftool | Jun 13, 2025 | Feb 27, 2025 |
| Huawei Euleros 2_0_sp12 | — | Upgrade kernel-abi-stablelistsUpgrade python3-perfUpgrade kernel-toolsUpgrade kernel-tools-libsUpgrade bpftoolUpgrade kernel | Jul 21, 2025 | Feb 27, 2025 |
| Huawei Euleros 2_0_sp13 | — | Upgrade kernelUpgrade bpftoolUpgrade python3-perfUpgrade kernel-tools-libsUpgrade kernel-toolsUpgrade kernel-abi-stablelists | Jul 1, 2025 | Feb 27, 2025 |
| Redhat_linux | — | No solution exists | Jul 9, 2025 | Feb 27, 2025 |
| Ubuntu | — | Upgrade linux-image-nvidia-hwe-22.04Upgrade linux-image-azure-6.8Upgrade linux-image-ibm-lts-24.04Upgrade linux-image-generic-hwe-24.04Upgrade linux-image-lowlatency-64k-hwe-22.04Upgrade linux-image-gcpUpgrade linux-image-generic-64k-6.8Upgrade linux-image-azure-nvidia-lts-24.04Upgrade linux-image-realtime-6.8.1Upgrade linux-image-6.8.0-1031-nvidiaUpgrade linux-image-oracle-6.8Upgrade linux-image-6.11.0-26-genericUpgrade linux-image-6.8.0-1034-azureUpgrade linux-image-virtual-6.8Upgrade linux-image-nvidia-6.8Upgrade linux-image-virtual-hwe-22.04Upgrade linux-image-6.11.0-1016-oracle-64kUpgrade linux-image-gke-6.8Upgrade linux-image-gcp-lts-24.04Upgrade linux-image-oracle-64k-lts-24.04Upgrade linux-image-oracle-64kUpgrade linux-image-azure-fde-6.8Upgrade linux-image-aws-64k-lts-24.04Upgrade linux-image-oem-24.04aUpgrade linux-image-lowlatency-64k-6.8Upgrade linux-image-generic-64k-hwe-22.04Upgrade linux-image-6.11.0-1014-lowlatencyUpgrade linux-image-6.8.0-1031-nvidia-lowlatency-64kUpgrade linux-image-6.8.0-1032-awsUpgrade linux-image-6.11.0-1014-lowlatency-64kUpgrade linux-image-gkeUpgrade linux-image-6.8.0-2026-raspi-realtimeUpgrade linux-image-aws-lts-24.04Upgrade linux-image-gcp-64kUpgrade linux-image-raspiUpgrade linux-image-6.8.0-1028-gkeUpgrade linux-image-6.8.0-1022-azure-nvidiaUpgrade linux-image-6.8.0-64-generic-64kUpgrade linux-image-gcp-64k-6.8Upgrade linux-image-raspi-6.8Upgrade linux-image-generic-hwe-22.04Upgrade linux-image-aws-6.8Upgrade linux-image-oem-22.04cUpgrade linux-image-oem-22.04dUpgrade linux-image-kvmUpgrade linux-image-nvidia-64kUpgrade linux-image-6.8.0-64-lowlatency-64kUpgrade linux-image-6.8.0-1034-azure-fdeUpgrade linux-image-6.8.0-1033-gcpUpgrade linux-image-azureUpgrade linux-image-6.8.0-1029-oracle-64kUpgrade linux-image-6.8.0-64-lowlatencyUpgrade linux-image-raspi-realtimeUpgrade linux-image-6.8.0-1029-oracleUpgrade linux-image-nvidia-lowlatencyUpgrade linux-image-realtimeUpgrade linux-image-oem-22.04bUpgrade linux-image-nvidia-lowlatency-64k-6.8Upgrade linux-image-awsUpgrade linux-image-6.8.0-1033-gcp-64kUpgrade linux-image-aws-64k-6.8Upgrade linux-image-6.8.0-64-genericUpgrade linux-image-gkeop-6.8Upgrade linux-image-oracle-lts-24.04Upgrade linux-image-generic-lpaeUpgrade linux-image-virtual-hwe-24.04Upgrade linux-image-oem-6.8Upgrade linux-image-generic-6.8Upgrade linux-image-aws-64kUpgrade linux-image-ibm-classicUpgrade linux-image-nvidia-lowlatency-6.8Upgrade linux-image-6.11.0-1022-oemUpgrade linux-image-ibmUpgrade linux-image-6.8.1-1025-realtimeUpgrade linux-image-6.8.0-1031-nvidia-lowlatencyUpgrade linux-image-6.8.0-1032-aws-64kUpgrade linux-image-lowlatency-hwe-24.04Upgrade linux-image-azure-lts-24.04Upgrade linux-image-6.11.0-26-generic-64kUpgrade linux-image-6.11.0-1015-azureUpgrade linux-image-6.11.0-1014-awsUpgrade linux-image-virtualUpgrade linux-image-generic-64kUpgrade linux-image-lowlatency-64k-hwe-24.04Upgrade linux-image-generic-64k-hwe-24.04Upgrade linux-image-gcp-6.8Upgrade linux-image-azure-nvidiaUpgrade linux-image-azure-fde-lts-24.04Upgrade linux-image-nvidia-64k-6.8Upgrade linux-image-6.11.0-1015-gcpUpgrade linux-image-6.8.0-1015-gkeopUpgrade linux-image-6.11.0-1015-gcp-64kUpgrade linux-image-oem-24.04bUpgrade linux-image-nvidia-64k-hwe-22.04Upgrade linux-image-lowlatency-6.8Upgrade linux-image-lowlatency-64kUpgrade linux-image-gcp-64k-lts-24.04Upgrade linux-image-6.11.0-1016-oracleUpgrade linux-image-lowlatency-hwe-22.04Upgrade linux-image-oem-22.04aUpgrade linux-image-6.8.0-1031-raspiUpgrade linux-image-nvidiaUpgrade linux-image-nvidia-lowlatency-64kUpgrade linux-image-6.11.0-1010-realtimeUpgrade linux-image-azure-nvidia-6.8Upgrade linux-image-azure-fdeUpgrade linux-image-6.8.0-1029-ibmUpgrade linux-image-lowlatencyUpgrade linux-image-6.11.0-1013-raspiUpgrade linux-image-6.11.0-1015-azure-fdeUpgrade linux-image-ibm-6.8Upgrade linux-image-oracleUpgrade linux-image-raspi-realtime-6.8Upgrade linux-image-6.8.0-1031-oemUpgrade linux-image-genericUpgrade linux-image-oracle-64k-6.8Upgrade linux-image-6.8.0-1031-nvidia-64kUpgrade linux-image-gkeopUpgrade linux-image-oem-22.04Upgrade linux-image-oem-24.04 | May 21, 2025 | Feb 27, 2025 |
Prioritise with Active Threat Intelligence
With curated Threat Intelligence, you can see which vulnerabilities truly put you at risk, prioritize what matters most, and act before attackers do.
Explore Intelligence Hub