CVE-2026-80849: net/tcp-ao: fix use-after-free of current_key on reconnect to another peer
In the Linux kernel, the following vulnerability has been resolved:
net/tcp-ao: fix use-after-free of currentkey on reconnect to another peer
tcpinboundaohash() is called before bhlocksocknested() is taken, with only rcureadlock() held. On the fast path for established sockets, if the rnextkeyid sent by the peer differs from currentkey->sndid, the key the peer asked for is looked up and stored in currentkey. The lookup is inside the RCU read side, but currentkey outlives it.
When the socket is disconnected and connect() is called again for another peer, tcpaoconnectinit() unlinks every key that does not match the new peer and frees it with callrcu(). If currentkey points at such a key, it is cleared to NULL.
The fast path reads skstate only once on entry, so a softirq that got into it while the socket was still established can update currentkey after that loop has already run. The update is inside the RCU read side, so it comes before the callrcu() callback, and once the callback frees the key, currentkey is left pointing at freed memory.
The next transmission picks that pointer up in tcpgetcurrentkey(). tcpaotransmitskb() then reads the traffic key from the freed object, which is the use-after-free.
Wait for one grace period before unlinking, and only if a key is going to be removed. By the time tcpconnect() runs the socket is already in TCPSYNSENT, and TCPAOESTABLISHED does not contain TCPFSYNSENT, so a softirq entering after the wait cannot reach the fast path, and the ones already in it have finished. The existing NULL handling in the loop is then enough.
Affected Software
Event History
Frequently Asked Questions
Which deployments are exposed to this race condition?
The affected path involves TCP Authentication Option (TCP-AO) sockets that are disconnected and then reconnected to a different peer. The race requires an established-socket fast path to update the current key after reconnection cleanup has unlinked the old peer's key.
What peer behavior is involved in triggering the vulnerable path?
The peer must send an rnext_keyid that differs from the socket's current key send ID, causing the inbound TCP-AO path to look up and store a different key as the current key. A concurrent reconnect to another peer can then leave that stored pointer referring to memory that has been freed.
What can be done before the kernel fix is deployed?
Avoid reusing TCP-AO sockets by disconnecting and reconnecting them to different peers. Creating or retaining separate sockets for separate peers avoids the reconnect sequence described as causing the stale key pointer.