Skip to main content
Vulnerability Database/CVE-2026-98595

CVE-2026-98595: Linux Kernel UDP Socket DOS Vulnerability

CVE-2026-98595 is a denial of service flaw in Linux kernel UDP socket handling where disconnected sockets remain in hash tables, causing performance degradation. This post covers technical details, impact, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-98595 Overview

CVE-2026-98595 affects the Linux kernel's UDP socket handling, where a disconnected socket retains its entry in the 4-tuple hash table. A UDP socket bound to a specific address and port keeps a stale entry after connect(AF_UNSPEC) disconnects it. The __udp_disconnect() function skips ->rehash() when SOCK_BINDADDR_LOCK is set and ->unhash() when SOCK_BINDPORT_LOCK is set. The stale entry affects packet routing through the 4-tuple lookup path. On IPv6, the stale sk_v6_daddr field allows datagrams from the former peer with a zero source port to match the orphaned entry.

Critical Impact

Stale UDP hash table entries can cause packets from previous peers to incorrectly match disconnected sockets, enabling unexpected packet delivery and bucket exhaustion on IPv6 systems.

Affected Products

  • Linux kernel (mainline, versions containing commit 644f9108f3a5)
  • Linux kernel branches with hash4 UDP socket lookup support
  • Downstream distributions shipping affected kernel versions

Discovery Timeline

  • 2026-10-18 - CVE CVE-2026-98595 published to NVD
  • 2026-10-19 - Last updated in NVD database

Technical Details for CVE-2026-98595

Vulnerability Analysis

The vulnerability resides in the UDP socket disconnect logic within the Linux networking stack. When a UDP socket bound to a specific address and port is disconnected via connect(AF_UNSPEC), the kernel fails to remove its entry from the 4-tuple hash table. The __udp_disconnect() function only removes socket table entries as a side effect of ->rehash() or ->unhash() operations. These paths are bypassed when SOCK_BINDADDR_LOCK or SOCK_BINDPORT_LOCK flags are set.

The stale entry keeps hash4_cnt raised on the hash2 slot for the socket's lifetime. As a result, udp_has_hash4() continues routing every packet for that address and port through the 4-tuple lookup first. A prior fix in commit 6996a2d2d0a6 addressed a similar condition for wildcard-bound sockets, but this specific code path was not covered.

Root Cause

The root cause is a logic error where __udp_disconnect() skips table removal when bind locks prevent ->rehash() or ->unhash() from executing. On IPv6, __udp_disconnect() additionally fails to clear sk_v6_daddr, so udp_v6_rehash() files the entry under the former peer address with a zero destination port. Subsequent SO_BINDTODEVICE calls trigger udp_lib_rehash(), which relocates the entry into a bucket determined purely by the receive address and port, collecting all affected sockets into one bucket.

Attack Vector

On IPv6, a datagram from the former peer with a zero source port can match the stale entry via inet6_match(), and source port zero is accepted on receive. On IPv4, the routing layer rejects martian source addresses, limiting the impact to resource accumulation. The entry relocation issue became reachable through commit 644f9108f3a5, which moved hash4 handling outside a branch that disconnected sockets do not take. The vulnerability requires local socket operations rather than remote network input to establish the condition.

For technical details of the fix, see the Linux Kernel Commit 9e95b1a, Linux Kernel Commit c21daf3, and Linux Kernel Commit d1b5fd9.

Detection Methods for CVE-2026-98595

Indicators of Compromise

  • Unexpected UDP datagram delivery to sockets that have been disconnected via connect(AF_UNSPEC)
  • IPv6 UDP packets with source port zero being accepted by processes that previously connected to a specific peer
  • Growth in hash bucket occupancy for UDP sockets sharing the same receive address and port after multiple disconnect and SO_BINDTODEVICE cycles

Detection Strategies

  • Audit kernel versions across the fleet to identify hosts running Linux builds that include commit 644f9108f3a5 but lack the fix commits
  • Monitor UDP applications that use connect(AF_UNSPEC) followed by SO_BINDTODEVICE for anomalous packet reception patterns
  • Instrument the UDP receive path with eBPF probes to track hash4 lookup counts and identify sockets with persistent hash4_cnt values after disconnect

Monitoring Recommendations

  • Collect kernel version telemetry from Linux endpoints and correlate against the fixed commit identifiers
  • Track UDP socket lifecycle events for applications that rely on bind locks and dynamic peer reassignment
  • Alert on UDP receive activity targeting ports associated with recently disconnected sockets, particularly on IPv6 interfaces

How to Mitigate CVE-2026-98595

Immediate Actions Required

  • Apply the upstream Linux kernel patches referenced in commits 9e95b1a, c21daf3, and d1b5fd9 as soon as vendor-supported builds are available
  • Update to the stable kernel release that incorporates these fixes for your distribution
  • Inventory Linux systems running UDP services with persistent sockets and prioritize patching for internet-facing hosts

Patch Information

The fix removes the socket from the 4-tuple hash table before __udp_disconnect() runs, while the entry still matches how it was filed. This also handles the wildcard case ahead of the udp_lib_rehash() branch for udp_unhash4(). The patches are available in Linux Kernel Commit 9e95b1a, Linux Kernel Commit c21daf3, and Linux Kernel Commit d1b5fd9.

Workarounds

  • Avoid application patterns that bind UDP sockets with SOCK_BINDADDR_LOCK or SOCK_BINDPORT_LOCK, then disconnect via connect(AF_UNSPEC)
  • Close and recreate UDP sockets rather than disconnecting them when peer reassignment is required
  • Restrict IPv6 UDP exposure for workloads using the affected disconnect pattern until the kernel patch is applied
bash
# Verify running kernel version and check for the fix
uname -r
# Compare against the stable kernel release notes that include commits
# 9e95b1a94c9c, c21daf37d5ce, and d1b5fd969cc5

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.