{"id":"CVE-2026-143292","sourceIdentifier":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","published":"2026-12-03T10:18:14.450","lastModified":"2026-12-04T04:17:47.407","vulnStatus":"Received","cveTags":[],"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\ntcp: wait for TIME_WAIT teardown before freeing per-netns ehash\n\ninet_twsk_kill() removes a TIME_WAIT socket from the established hash\nbefore it finishes using the ehash lock, hashinfo and bind tables, and\nbefore it drops the death-row reference. A running timer can therefore\nunhash its socket before inet_twsk_purge() reaches it. The purge cannot\nsynchronize with that timer, and tcp_sk_exit_batch() can free the\nprivate ehash and hashinfo while inet_twsk_kill() is still using them.\n\nAn unprivileged reproducer using user and network namespaces, a private\nTCP ehash and a FIN_WAIT2 timer triggers a KASAN slab-use-after-free in\ninet_twsk_kill(). The allocation and free stacks point to\ninet_pernet_hashinfo_alloc() and inet_pernet_hashinfo_free().\n\nWait for an RCU grace period after purging the whole batch, if one\nnetns in the batch uses a private ehash. TIME_WAIT removal runs with\nbottom halves disabled, so this also waits for removers that were\nalready invisible to the purge. Keep the wait under\ntcp_exit_batch_mutex, before freeing any private hashinfo.\n\nThe same window exists with the shared tcp_hashinfo. There, the\nhashinfo memory stays valid, but tcp_sk_exit_batch() can decrement\ntcp_death_row.tw_refcount from 2 to 1 before inet_twsk_kill() drops its\nown reference. This triggers the WARN_ON_ONCE() in tcp_sk_exit_batch(),\nthen a refcount_t \"decrement hit 0\" warning from inet_twsk_kill().\n\nAdding a grace period for the shared case would be costly on busy\nhosts. It is not needed: struct net is freed by a later cleanup_net(),\nafter the synchronize_rcu() in ops_undo_list(), so inet_twsk_kill()\ncan safely drop the last tw_refcount reference itself.\nUse refcount_dec_if_one() and only warn if tw_refcount is not 1\nafter a grace period.\n\n[edumazet: only call synchronize_net() if one netns in the batch uses a private ehash,\n use refcount_dec_if_one() to avoid a false WARN with the shared ehash]"}],"affected":[{"source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","affectedData":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","programFiles":["net/ipv4/tcp_ipv4.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","versions":[{"version":"d1e5e6408b305ff78b825d437df8d3f77e82a4be","lessThan":"068877fbd13041f01b9c20687a82c0773158b200","versionType":"git","status":"affected"},{"version":"d1e5e6408b305ff78b825d437df8d3f77e82a4be","lessThan":"3f4e42618b5c2cbeb4e36a7b7fb1047cced39bce","versionType":"git","status":"affected"},{"version":"d1e5e6408b305ff78b825d437df8d3f77e82a4be","lessThan":"0a987038ea68d3c14ea905c817855b2e58ace158","versionType":"git","status":"affected"},{"version":"d1e5e6408b305ff78b825d437df8d3f77e82a4be","lessThan":"647b81ddefc6364290e67bf33c89d54971f8995e","versionType":"git","status":"affected"}]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","programFiles":["net/ipv4/tcp_ipv4.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","versions":[{"version":"6.1","status":"affected"},{"version":"0","lessThan":"6.1","versionType":"semver","status":"unaffected"},{"version":"6.12.120","lessThanOrEqual":"6.12.*","versionType":"semver","status":"unaffected"},{"version":"6.18.66","lessThanOrEqual":"6.18.*","versionType":"semver","status":"unaffected"},{"version":"7.3.7","lessThanOrEqual":"7.3.*","versionType":"semver","status":"unaffected"},{"version":"7.4-rc2","lessThanOrEqual":"*","versionType":"original_commit_for_fix","status":"unaffected"}]}]}],"metrics":{"cvssMetricV31":[{"source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","type":"Secondary","cvssData":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH","attackVector":"LOCAL","attackComplexity":"LOW","privilegesRequired":"LOW","userInteraction":"NONE","scope":"UNCHANGED","confidentialityImpact":"HIGH","integrityImpact":"HIGH","availabilityImpact":"HIGH"},"exploitabilityScore":1.8,"impactScore":5.9}]},"references":[{"url":"https://git.kernel.org/stable/c/068877fbd13041f01b9c20687a82c0773158b200","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"},{"url":"https://git.kernel.org/stable/c/0a987038ea68d3c14ea905c817855b2e58ace158","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"},{"url":"https://git.kernel.org/stable/c/3f4e42618b5c2cbeb4e36a7b7fb1047cced39bce","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"},{"url":"https://git.kernel.org/stable/c/647b81ddefc6364290e67bf33c89d54971f8995e","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"}]}