AZL-118514: CVE-2026-143292 affecting package kernel 6.6.161.1-1
In the Linux kernel, the following vulnerability has been resolved:
tcp: wait for TIMEWAIT teardown before freeing per-netns ehash
inettwskkill() removes a TIMEWAIT 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 inettwskpurge() reaches it. The purge cannot synchronize with that timer, and tcpskexitbatch() can free the private ehash and hashinfo while inettwskkill() is still using them.
An unprivileged reproducer using user and network namespaces, a private TCP ehash and a FINWAIT2 timer triggers a KASAN slab-use-after-free in inettwskkill(). The allocation and free stacks point to inetpernethashinfoalloc() and inetpernethashinfofree().
Wait for an RCU grace period after purging the whole batch, if one netns in the batch uses a private ehash. TIMEWAIT removal runs with bottom halves disabled, so this also waits for removers that were already invisible to the purge. Keep the wait under tcpexitbatchmutex, before freeing any private hashinfo.
The same window exists with the shared tcphashinfo. There, the hashinfo memory stays valid, but tcpskexitbatch() can decrement tcpdeathrow.twrefcount from 2 to 1 before inettwskkill() drops its own reference. This triggers the WARNONONCE() in tcpskexitbatch(), then a refcountt "decrement hit 0" warning from inettwskkill().
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 cleanupnet(), after the synchronizercu() in opsundolist(), so inettwskkill() can safely drop the last twrefcount reference itself. Use refcountdecifone() and only warn if twrefcount is not 1 after a grace period.
[edumazet: only call synchronizenet() if one netns in the batch uses a private ehash, use refcountdecifone() to avoid a false WARN with the shared ehash]
Affected Software
Event History
Frequently Asked Questions
What conditions are needed to trigger the issue?
The described reproducer is unprivileged but uses user and network namespaces, a private TCP established hash, and a FIN_WAIT2 timer. The race occurs when TIME_WAIT socket teardown overlaps network-namespace cleanup and private hash information is freed.
Is the issue limited to private TCP hash tables?
No. The description states that the same race window exists when using the shared tcp_hashinfo, although the reproduced use-after-free involves a private per-network-namespace ehash.
How can I identify evidence of exploitation or triggering?
The reported failure is a KASAN slab-use-after-free in inet_twsk_kill(). Allocation and free stack traces may identify inet_pernet_hashinfo_alloc() and inet_pernet_hashinfo_free().