{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.2",
    "cveMetadata": {
        "cveId": "CVE-2026-143292",
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "state": "PUBLISHED",
        "assignerShortName": "Linux",
        "dateReserved": "2026-12-03T03:10:28.365Z",
        "datePublished": "2026-12-03T09:21:26.953Z",
        "dateUpdated": "2026-12-04T03:32:24.157Z"
    },
    "containers": {
        "cna": {
            "providerMetadata": {
                "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
                "shortName": "Linux",
                "dateUpdated": "2026-12-04T03:32:24.157Z"
            },
            "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]"
                }
            ],
            "metrics": [
                {
                    "cvssV3_1": {
                        "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"
                    },
                    "scenarios": [
                        {
                            "lang": "en",
                            "value": "AV:L - tcp_sk_exit_batch() frees the private hashinfo from cleanup_net() via ops_exit_list() when the attacker drops a netns created by unshare/clone(CLONE_NEWNET). No TCP segment carries the bad state: they write tcp_child_ehash_entries so tcp_set_hashinfo() calls inet_pernet_hashinfo_alloc(), then tcp_time_wait(TCP_FIN_WAIT2) arms the timer that races that free.\nAC:L - The attacker schedules tw_timer_handler() with setsockopt(TCP_LINGER2), which tcp_fin_time() turns into the tw timer, and runs tcp_sk_exit_batch() by exiting that same netns. inet_twsk_kill() unhashes the twsk before tcp_twsk_purge() can timer_shutdown_sync() it; repeating close against netns exit hits that window.\nPR:L - unshare_nsproxy_namespaces() allows CLONE_NEWNET with CAP_SYS_ADMIN in the caller's user namespace, and net_ctl_permissions() lets that namespace's CAP_NET_ADMIN write net.ipv4.tcp_child_ehash_entries (mode 0644). An unprivileged user can do this; init-namespace root is not required.\nUI:N - The attacker creates the user and net namespaces, writes the sysctl, connects and closes their own sockets so tcp_close() or tcp_rcv_state_process() reaches tcp_time_wait(), and drops the netns. No other user has to mount, accept, or click.\nS:U - inet_twsk_kill()'s use-after-free of the per-netns inet_hashinfo corrupts memory in the same kernel the local user is already running in. That is host kernel privilege escalation, not a guest-to-host or IOMMU boundary crossing.\nC:H - inet_pernet_hashinfo_free() kfree()s the inet_hashinfo from inet_pernet_hashinfo_alloc()'s kmemdup while inet_twsk_kill() still loads ehash_locks, bhash and bhash_size and dereferences them. Reclaiming that slab chooses those pointers, which is an arbitrary read rather than a few-byte leak.\nI:H - Once the hashinfo slab is reused, inet_twsk_kill() spin_lock()s attacker-chosen ehash_locks and bhash entries, and inet_twsk_bind_unhash() rewrites bind-hash lists and may kmem_cache_free() through bind2_bucket_cachep. Those are kernel write and control-flow primitives.\nA:H - KASAN reports a slab-use-after-free in inet_twsk_kill() on the hashinfo object tcp_sk_exit_batch() already passed to inet_pernet_hashinfo_free(). The FIN_WAIT2 timer touching that freed object oopses the kernel."
                        }
                    ]
                }
            ],
            "affected": [
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "unaffected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "net/ipv4/tcp_ipv4.c"
                    ],
                    "versions": [
                        {
                            "version": "d1e5e6408b305ff78b825d437df8d3f77e82a4be",
                            "lessThan": "068877fbd13041f01b9c20687a82c0773158b200",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "d1e5e6408b305ff78b825d437df8d3f77e82a4be",
                            "lessThan": "3f4e42618b5c2cbeb4e36a7b7fb1047cced39bce",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "d1e5e6408b305ff78b825d437df8d3f77e82a4be",
                            "lessThan": "0a987038ea68d3c14ea905c817855b2e58ace158",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "d1e5e6408b305ff78b825d437df8d3f77e82a4be",
                            "lessThan": "647b81ddefc6364290e67bf33c89d54971f8995e",
                            "status": "affected",
                            "versionType": "git"
                        }
                    ]
                },
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "affected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "net/ipv4/tcp_ipv4.c"
                    ],
                    "versions": [
                        {
                            "version": "6.1",
                            "status": "affected"
                        },
                        {
                            "version": "0",
                            "lessThan": "6.1",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.12.120",
                            "lessThanOrEqual": "6.12.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.18.66",
                            "lessThanOrEqual": "6.18.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "7.3.7",
                            "lessThanOrEqual": "7.3.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "7.4-rc2",
                            "lessThanOrEqual": "*",
                            "status": "unaffected",
                            "versionType": "original_commit_for_fix"
                        }
                    ]
                }
            ],
            "cpeApplicability": [
                {
                    "nodes": [
                        {
                            "operator": "OR",
                            "negate": false,
                            "cpeMatch": [
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.1",
                                    "versionEndExcluding": "6.12.120"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.1",
                                    "versionEndExcluding": "6.18.66"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.1",
                                    "versionEndExcluding": "7.3.7"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.1",
                                    "versionEndExcluding": "7.4-rc2"
                                }
                            ]
                        }
                    ]
                }
            ],
            "references": [
                {
                    "url": "https://git.kernel.org/stable/c/068877fbd13041f01b9c20687a82c0773158b200"
                },
                {
                    "url": "https://git.kernel.org/stable/c/3f4e42618b5c2cbeb4e36a7b7fb1047cced39bce"
                },
                {
                    "url": "https://git.kernel.org/stable/c/0a987038ea68d3c14ea905c817855b2e58ace158"
                },
                {
                    "url": "https://git.kernel.org/stable/c/647b81ddefc6364290e67bf33c89d54971f8995e"
                }
            ],
            "title": "tcp: wait for TIME_WAIT teardown before freeing per-netns ehash",
            "x_generator": {
                "engine": "bippy-1.2.0"
            }
        }
    }
}