AZL-117776: CVE-2026-142949 affecting package kernel 6.6.161.1-1
In the Linux kernel, the following vulnerability has been resolved:
tcp: fix NULL pointer dereference when restarting a Fast Open listener
When a valid RST is received for a Fast Open child accepted before the three-way handshake completes, reqskfastopenremove() adds the requestsock to the listener's RST list if the listener is in TCPLISTEN.
An application can call shutdown(SHUTRD) on a listener socket. inetcsklistenstop() checks rskqrsthead without holding fastopenq.lock. If rskqrsthead is NULL, it does not acquire the lock and therefore does not synchronize with an insertion by reqskfastopenremove() after that function has passed the TCPLISTEN check.
The more likely outcome of this race, even without a subsequent listen(), is a leak. If reqskfastopenremove() inserts a requestsock after inetcsklistenstop() observes an empty list and returns, the requestsock is stranded in rskqrsthead and keeps a reference on the listener. The socket is already in TCPCLOSE, so a subsequent close() does not call inetcsklistenstop() again.
If listen() is called again on the same socket before the delayed list insertion, the insertion can overlap the queue initialization in reqskqueuealloc(). If it occurs after rskqrsthead is set to NULL but before rskqrsttail is set to NULL, rskqrsthead points to the requestsock while rskqrsttail is NULL.
When a valid RST is later received for another accepted Fast Open child, rskqrsthead is not NULL, so reqskfastopenremove() attempts to write the requestsock pointer to rskqrsttail->dlnext while rskqrsttail is NULL. KASAN reports:
BUG: KASAN: null-ptr-deref in reqskfastopenremove+0x147/0x210 Write of size 8 at addr 0000000000000088 by task swapper/3/0 ... Call Trace: <IRQ> ... reqskfastopenremove+0x147/0x210 tcpcheckreq+0xa70/0x1060 ... tcprcvstateprocess+0x1cb/0x2ae0 ... tcpv4dorcv+0x1fe/0x740 tcpv4rcv+0x1744/0x2070 ... ipprotocoldeliverrcu+0x5c/0x280 iplocaldeliverfinish+0x171/0x330 iplocaldeliver+0x107/0x370 ... </IRQ>
To widen the race window, the issue was reproduced after adding mdelay(3000) immediately after reqskfastopenremove() checks that the listener is in TCPLISTEN and immediately after reqskqueuealloc() sets rskqrsthead to NULL.
Make inetcsklistenstop() acquire fastopenq.lock regardless of the value of rskqrsthead and detach the list while holding the lock. With this synchronization, reqskfastopenremove() either inserts the requestsock before inetcsklistenstop() acquires the lock, in which case inetcsklistenstop() reclaims it, or sees that the listener is not in TCPLISTEN and does not insert anything.
Affected Software
Event History
Frequently Asked Questions
What conditions are needed to trigger this issue?
A TCP Fast Open child must be accepted before the three-way handshake completes, and that child must receive a valid RST. The race involves an application calling shutdown(SHUT_RD) on the listener and, in the NULL-dereference scenario, calling listen() again on the same socket while delayed request insertion overlaps queue initialization.
Which applications are most relevant to triage?
Applications that use TCP Fast Open listeners and manipulate listener sockets with shutdown(SHUT_RD), close(), or a subsequent listen() call are the relevant exposure set. The described race is in listener shutdown and Fast Open request handling rather than ordinary established TCP connections.
What impact can occur if the race is hit?
The more likely outcome described is a leaked request_sock that remains on the listener RST list and retains a reference to a listener already in TCP_CLOSE. Re-listening on the same socket during the delayed insertion can overlap queue initialization and lead to a NULL pointer dereference.