CVE-2026-98595
In the Linux kernel, the following vulnerability has been resolved:
udp: remove a disconnected socket from the 4-tuple hash table
A UDP socket bound to a specific address and port keeps its entry in the 4-tuple hash table after it is disconnected:
__udp_disconnect() takes a socket out of that table only as a side effect of ->rehash() or ->unhash(), and it skips ->rehash() when SOCK_BINDADDR_LOCK is set and ->unhash() when SOCK_BINDPORT_LOCK is set. commit 6996a2d2d0a6 ("udp: Unhash auto-bound connected sk from 4-tuple hash table when disconnected.") fixed the same end state for a wildcard-bound socket, by a path this one does not take.
Read full descriptionShow less
The entry is counted whether or not anything hits it. hash4_cnt on the hash2 slot stays raised for as long as the socket lives, so udp_has_hash4() keeps sending every packet for that address and port through the 4-tuple lookup first.
On IPv6 it can also be hit. __udp_disconnect() does not clear sk_v6_daddr, so udp_v6_rehash() files the entry under the peer the socket was connected to with a zero dport, and inet6_match() compares that same field: a datagram from the former peer with a zero source port matches, and source port zero is accepted on receive. On IPv4 the peer is cleared, so a match would need a zero source address as well, which the routing layer rejects as martian. The stale sk_v6_daddr is a separate defect, not addressed here; removing the entry closes this path either way.
The entry can also be relocated. __udp_disconnect() clears sk_bound_dev_if, so a subsequent SO_BINDTODEVICE calls ->rehash(), and because the receive address is still specific udp_lib_rehash() moves the entry instead of removing it, into the bucket that (rcv_saddr, num, 0, 0) hashes to -- a pure function of the address and port, so every socket reaching this state on one address and port collects in one bucket. The bucket cannot be chosen from outside, as udp_ehashfn() is seeded with a per-boot secret. This last one became reachable only with commit 644f9108f3a5 ("udp: Make rehash4 independent in udp_lib_rehash()"), which moved the hash4 handling out of a branch a disconnected socket does not take; the stale entry itself dates from the commit in Fixes.
Take the socket out of the table before __udp_disconnect() runs, while it still matches how it was filed. This also reaches the wildcard case ahead of udp_lib_rehash()'s udp_unhash4() branch, leaving that branch unreachable from udp_disconnect(); removing it belongs in net-next. udp_disconnect() and udp_abort() are the only UDP entries into __udp_disconnect(), which is shared with raw, ping and l2tp sockets that are not struct udp_sock: ping_prot.obj_size is sizeof(struct inet_sock), so udp_hashed4() on one would read past the allocation.
Technical details traces, logs and code from the original report
sk binds to 127.0.0.1:21001
sk connects to 127.0.0.2:20001 // filed in the 4-tuple table
sk disconnects, connect(AF_UNSPEC) // still filed, peer now 0.0.0.0:0CVSS
NVD hasn't assigned a CVSS score to this CVE (common since the April 2026 policy change).
Exploitation probability (EPSS)
- Probability of exploitation in the next 30 days
- 0.20 %
- Percentile among all scored CVEs
- 9
- Score date
- 10/20/2026
EPSS (Exploit Prediction Scoring System, FIRST) estimates how likely a vulnerability is to be exploited in the wild within 30 days. It complements CVSS (impact) and CISA KEV (confirmed exploitation).
Affected technologies (1)
⚠ AI-inferred from the description — NVD hasn't analyzed this CVE yet, these aren't verified CPEs.
References
Raw JSON (NVD)
Show
{
"id": "CVE-2026-98595",
"cveTags": [],
"metrics": {},
"affected": [
{
"source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
"affectedData": [
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"vendor": "Linux",
"product": "Linux",
"versions": [
{
"status": "affected",
"version": "78c91ae2c6deb5d236a5a93ff2995cdd05514380",
"lessThan": "c21daf37d5ce9a4e234b7c42238ac1e6041e28e4",
"versionType": "git"
},
{
"status": "affected",
"version": "78c91ae2c6deb5d236a5a93ff2995cdd05514380",
"lessThan": "d1b5fd969cc53f29d02b82b05a45135de4a6087a",
"versionType": "git"
},
{
"status": "affected",
"version": "78c91ae2c6deb5d236a5a93ff2995cdd05514380",
"lessThan": "9e95b1a94c9c49b4ba722251bbca2759b9c51737",
"versionType": "git"
}
],
"programFiles": [
"net/ipv4/udp.c"
],
"defaultStatus": "unaffected"
},
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"vendor": "Linux",
"product": "Linux",
"versions": [
{
"status": "affected",
"version": "6.13"
},
{
"status": "unaffected",
"version": "0",
"lessThan": "6.13",
"versionType": "semver"
},
{
"status": "unaffected",
"version": "6.18.55",
"versionType": "semver",
"lessThanOrEqual": "6.18.*"
},
{
"status": "unaffected",
"version": "7.2.9",
"versionType": "semver",
"lessThanOrEqual": "7.2.*"
},
{
"status": "unaffected",
"version": "7.3",
"versionType": "original_commit_for_fix",
"lessThanOrEqual": "*"
}
],
"programFiles": [
"net/ipv4/udp.c"
],
"defaultStatus": "affected"
}
]
}
],
"published": "2026-10-18T16:17:12.163",
"references": [
{
"url": "https://git.kernel.org/stable/c/9e95b1a94c9c49b4ba722251bbca2759b9c51737",
"source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
},
{
"url": "https://git.kernel.org/stable/c/c21daf37d5ce9a4e234b7c42238ac1e6041e28e4",
"source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
},
{
"url": "https://git.kernel.org/stable/c/d1b5fd969cc53f29d02b82b05a45135de4a6087a",
"source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
}
],
"vulnStatus": "Received",
"descriptions": [
{
"lang": "en",
"value": "In the Linux kernel, the following vulnerability has been resolved:\n\nudp: remove a disconnected socket from the 4-tuple hash table\n\nA UDP socket bound to a specific address and port keeps its entry in the\n4-tuple hash table after it is disconnected:\n\n sk binds to 127.0.0.1:21001\n sk connects to 127.0.0.2:20001\t// filed in the 4-tuple table\n sk disconnects, connect(AF_UNSPEC)\t// still filed, peer now 0.0.0.0:0\n\n__udp_disconnect() takes a socket out of that table only as a side effect\nof ->rehash() or ->unhash(), and it skips ->rehash() when\nSOCK_BINDADDR_LOCK is set and ->unhash() when SOCK_BINDPORT_LOCK is set.\ncommit 6996a2d2d0a6 (\"udp: Unhash auto-bound connected sk from 4-tuple hash\ntable when disconnected.\") fixed the same end state for a wildcard-bound\nsocket, by a path this one does not take.\n\nThe entry is counted whether or not anything hits it. hash4_cnt on the\nhash2 slot stays raised for as long as the socket lives, so udp_has_hash4()\nkeeps sending every packet for that address and port through the 4-tuple\nlookup first.\n\nOn IPv6 it can also be hit. __udp_disconnect() does not clear sk_v6_daddr,\nso udp_v6_rehash() files the entry under the peer the socket was connected\nto with a zero dport, and inet6_match() compares that same\nfield: a datagram from the former peer with a zero source port matches,\nand source port zero is accepted on receive. On IPv4 the peer is cleared,\nso a match would need a zero source address as well, which the routing\nlayer rejects as martian. The stale sk_v6_daddr is a separate defect, not\naddressed here; removing the entry closes this path either way.\n\nThe entry can also be relocated. __udp_disconnect() clears sk_bound_dev_if,\nso a subsequent SO_BINDTODEVICE calls ->rehash(), and because the receive\naddress is still specific udp_lib_rehash() moves the entry instead of\nremoving it, into the bucket that (rcv_saddr, num, 0, 0) hashes to -- a\npure function of the address and port, so every socket reaching this state\non one address and port collects in one bucket. The bucket cannot be chosen\nfrom outside, as udp_ehashfn() is seeded with a per-boot secret. This last\none became reachable only with commit 644f9108f3a5 (\"udp: Make rehash4\nindependent in udp_lib_rehash()\"), which moved the hash4 handling out of a\nbranch a disconnected socket does not take; the stale entry itself dates\nfrom the commit in Fixes.\n\nTake the socket out of the table before __udp_disconnect() runs, while it\nstill matches how it was filed. This also reaches the wildcard case ahead\nof udp_lib_rehash()'s udp_unhash4() branch, leaving that branch unreachable\nfrom udp_disconnect(); removing it belongs in net-next. udp_disconnect()\nand udp_abort() are the only UDP entries into __udp_disconnect(), which is\nshared with raw, ping and l2tp sockets that are not struct udp_sock:\nping_prot.obj_size is sizeof(struct inet_sock), so udp_hashed4() on one\nwould read past the allocation."
}
],
"lastModified": "2026-10-19T10:19:20.767",
"sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
}