CVE-2026-99213: vsock: treat TCP_CLOSING as once-established
In the Linux kernel, the following vulnerability has been resolved:
vsock: treat TCPCLOSING as once-established
Handle the TCPESTABLISHED -> TCPCLOSING transition on OPRST, which can race with the connect loop. Immediately break and return 0 on ESTABLISHED/CLOSING. The return value of connect() should reflect what happened up to the point the connection was established or failed. Events that occur afterwards must not affect it. E.g. even if OPRW has already set skerr, connect() should still return 0, not ENOBUFS because of it. Adapt the inaccurate comment above signalpending().
Resetting a socket that is still present in connectedtable can lead to memory corruption. The reporter noted lost transports for in-flight skbs, and I have reproduced crashes caused by re-insertion into connectedtable.
listadd double add: new=, prev=, next=. kernel BUG at lib/listdebug.c:35! Oops: invalid opcode: 0000 [#1] SMP KASAN NOPTI Workqueue: vsock-loopback vsockloopbackwork RIP: 0010:listaddvalidorreport+0x11f/0x130 Call Trace: vsockinsertconnected.cold+0xe/0x13 virtiotransportrecvpkt+0x10e9/0x1460 vsockloopbackwork+0x305/0x480 processonework+0xe4c/0x1560 workerthread+0x4f1/0xd60 kthread+0x36e/0x470 retfromfork+0x47b/0x6b0 retfromforkasm+0x1a/0x30
This fix is supplementary to commit 002541ef650b ("vsock: Ignore signal/timeout on connect() if already established"). Details under Link.