tcp: wait for TIME_WAIT teardown before freeing per-netns ehash

Summary

CVECVE-2026-143292
StatePUBLISHED
AssignerLinux
Source PriorityCVE Program / NVD first with legacy fallback
Published2026-12-03 10:18:14 UTC
Updated2026-12-04 04:17:47 UTC
DescriptionIn the Linux kernel, the following vulnerability has been resolved: tcp: wait for TIME_WAIT teardown before freeing per-netns ehash inet_twsk_kill() removes a TIME_WAIT socket from the established hash before it finishes using the ehash lock, hashinfo and bind tables, and before it drops the death-row reference. A running timer can therefore unhash its socket before inet_twsk_purge() reaches it. The purge cannot synchronize with that timer, and tcp_sk_exit_batch() can free the private ehash and hashinfo while inet_twsk_kill() is still using them. An unprivileged reproducer using user and network namespaces, a private TCP ehash and a FIN_WAIT2 timer triggers a KASAN slab-use-after-free in inet_twsk_kill(). The allocation and free stacks point to inet_pernet_hashinfo_alloc() and inet_pernet_hashinfo_free(). Wait for an RCU grace period after purging the whole batch, if one netns in the batch uses a private ehash. TIME_WAIT removal runs with bottom halves disabled, so this also waits for removers that were already invisible to the purge. Keep the wait under tcp_exit_batch_mutex, before freeing any private hashinfo. The same window exists with the shared tcp_hashinfo. There, the hashinfo memory stays valid, but tcp_sk_exit_batch() can decrement tcp_death_row.tw_refcount from 2 to 1 before inet_twsk_kill() drops its own reference. This triggers the WARN_ON_ONCE() in tcp_sk_exit_batch(), then a refcount_t "decrement hit 0" warning from inet_twsk_kill(). Adding a grace period for the shared case would be costly on busy hosts. It is not needed: struct net is freed by a later cleanup_net(), after the synchronize_rcu() in ops_undo_list(), so inet_twsk_kill() can safely drop the last tw_refcount reference itself. Use refcount_dec_if_one() and only warn if tw_refcount is not 1 after a grace period. [edumazet: only call synchronize_net() if one netns in the batch uses a private ehash, use refcount_dec_if_one() to avoid a false WARN with the shared ehash]

Risk And Classification

Primary CVSS: v3.1 7.8 HIGH from 416baaa9-dc9f-4396-8d5f-8c081fb06d67

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

EPSS: 0.002090000 probability, percentile 0.116640000 (date 2026-12-03)


VersionSourceTypeScoreSeverityVector
3.1416baaa9-dc9f-4396-8d5f-8c081fb06d67Secondary7.8HIGHCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
3.1CNADECLARED7.8HIGHCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

CVSS v3.1 Breakdown

Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Vendor Declared Affected Products

SourceVendorProductVersionPlatforms
CNA Linux Linux affected d1e5e6408b305ff78b825d437df8d3f77e82a4be 068877fbd13041f01b9c20687a82c0773158b200 git Not specified
CNA Linux Linux affected d1e5e6408b305ff78b825d437df8d3f77e82a4be 3f4e42618b5c2cbeb4e36a7b7fb1047cced39bce git Not specified
CNA Linux Linux affected d1e5e6408b305ff78b825d437df8d3f77e82a4be 0a987038ea68d3c14ea905c817855b2e58ace158 git Not specified
CNA Linux Linux affected d1e5e6408b305ff78b825d437df8d3f77e82a4be 647b81ddefc6364290e67bf33c89d54971f8995e git Not specified
CNA Linux Linux affected 6.1 Not specified
CNA Linux Linux unaffected 6.1 semver Not specified
CNA Linux Linux unaffected 6.12.120 6.12.* semver Not specified
CNA Linux Linux unaffected 6.18.66 6.18.* semver Not specified
CNA Linux Linux unaffected 7.3.7 7.3.* semver Not specified
CNA Linux Linux unaffected 7.4-rc2 * original_commit_for_fix Not specified

References

ReferenceSourceLinkTags
git.kernel.org/stable/c/3f4e42618b5c2cbeb4e36a7b7fb1047cced39bce 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/0a987038ea68d3c14ea905c817855b2e58ace158 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/647b81ddefc6364290e67bf33c89d54971f8995e 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/068877fbd13041f01b9c20687a82c0773158b200 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
CVE Program record CVE.ORG www.cve.org canonical
NVD vulnerability detail NVD nvd.nist.gov canonical, analysis

© CVE.report 2026

Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. It is the responsibility of user to evaluate the accuracy, completeness or usefulness of any information, opinion, advice or other content. EACH USER WILL BE SOLELY RESPONSIBLE FOR ANY consequences of his or her direct or indirect use of this web site. ALL WARRANTIES OF ANY KIND ARE EXPRESSLY DISCLAIMED. This site will NOT BE LIABLE FOR ANY DIRECT, INDIRECT or any other kind of loss.

CVE, CWE, and OVAL are registred trademarks of The MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. This site includes MITRE data granted under the following license.

Free CVE JSON API cve.report/api

CVE.report and Source URL Uptime Status status.cve.report