{"schema":"threatline.record/2","record":{"id":"CVE-2026-98595","aliases":[],"summary":"udp: remove a disconnected socket from the 4-tuple hash table","details":"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.","categories":["Operating systems"],"product":"Linux","vendor":"Linux","ecosystem":null,"affected_ranges":[{"source":"CVE List","source_url":"https://www.cve.org/CVERecord?id=CVE-2026-98595","source_modified_at":"2026-10-19T09:22:20.774Z","fetched_at":"2026-10-23T18:45:31.882637Z","product":"Linux","vendor":"Linux","versions":[{"version":"78c91ae2c6deb5d236a5a93ff2995cdd05514380","lessThan":"c21daf37d5ce9a4e234b7c42238ac1e6041e28e4","status":"affected","versionType":"git"},{"version":"78c91ae2c6deb5d236a5a93ff2995cdd05514380","lessThan":"d1b5fd969cc53f29d02b82b05a45135de4a6087a","status":"affected","versionType":"git"},{"version":"78c91ae2c6deb5d236a5a93ff2995cdd05514380","lessThan":"9e95b1a94c9c49b4ba722251bbca2759b9c51737","status":"affected","versionType":"git"}],"defaultStatus":"unaffected"},{"source":"CVE List","source_url":"https://www.cve.org/CVERecord?id=CVE-2026-98595","source_modified_at":"2026-10-19T09:22:20.774Z","fetched_at":"2026-10-23T18:45:31.882637Z","product":"Linux","vendor":"Linux","versions":[{"version":"6.13","status":"affected"},{"version":"0","lessThan":"6.13","status":"unaffected","versionType":"semver"},{"version":"6.18.55","lessThanOrEqual":"6.18.*","status":"unaffected","versionType":"semver"},{"version":"7.2.9","lessThanOrEqual":"7.2.*","status":"unaffected","versionType":"semver"},{"version":"7.3","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}],"defaultStatus":"affected"}],"fixed_versions":[{"source":"CVE List","source_url":"https://www.cve.org/CVERecord?id=CVE-2026-98595","source_modified_at":"2026-10-19T09:22:20.774Z","fetched_at":"2026-10-23T18:45:31.882637Z","package":{"name":"Linux","ecosystem":null},"version":"9e95b1a94c9c49b4ba722251bbca2759b9c51737","basis":"first unaffected version stated in the CVE record"}],"cvss":null,"severity":null,"kev":{"listed":false},"epss":{"probability":0.00198,"percentile":0.09056,"score_date":"2026-10-23"},"published_at":"2026-10-18T15:19:07.840Z","modified_at":"2026-10-19T09:22:20.774Z","provenance":[{"source":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2026-98595","fetched_at":"2026-10-23T18:45:31.882637Z","source_modified_at":"2026-10-19T09:22:20.774Z"},{"source":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2026-98595","fetched_at":"2026-10-23T18:42:43.628194Z","source_modified_at":"2026-10-23"}],"sources":["CVE List","EPSS"],"references":[{"source":"CVE List","url":"https://git.kernel.org/stable/c/c21daf37d5ce9a4e234b7c42238ac1e6041e28e4"},{"source":"CVE List","url":"https://git.kernel.org/stable/c/d1b5fd969cc53f29d02b82b05a45135de4a6087a"},{"source":"CVE List","url":"https://git.kernel.org/stable/c/9e95b1a94c9c49b4ba722251bbca2759b9c51737"}],"locations":[],"motoko_assessment":{"status":"requires_architecture_review","automatic_remediation":false},"cve_state":"PUBLISHED","classification":{"method":"product-first software-layer rules","rules_version":"2.1","matched_on":"product","confidence":"heuristic","reviewed":false},"change_timestamp":"2026-10-19T09:22:20.774Z","content_hash":"847c68120cbb1f569c7dd05690fcdc0d8e26f87c6ad6a71572336e63f919efea"}}
