CVE-2026-99138: tcp: fix use-after-free in do_tcp_getsockopt(TCP_CC_INFO)
In the Linux kernel, the following vulnerability has been resolved:
tcp: fix use-after-free in dotcpgetsockopt(TCPCCINFO)
dotcpgetsockopt() reads icsk->icskcaops and dereferences the getinfo function pointer without rcureadlock(). With BPF structops congestion control, caops can point to dynamically allocated memory that is freed concurrently, resulting in a use-after-free when the kernel dereferences or calls through the stale pointer.
BUG: KASAN: slab-use-after-free in dotcpgetsockopt+0x2037/0x23e0 Read of size 8 at addr ffff888013701258 by task exploit/149 dotcpgetsockopt+0x2037/0x23e0 (net/ipv4/tcp.c:4564) tcpgetsockopt+0x91/0xf0 sysgetsockopt+0xf7/0x170
Fix this by wrapping the caops load and getinfo call within rcureadlock()/rcureadunlock(), and using READONCE() to load the icskcaops pointer.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.10.273 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.15.224 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.1.191 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.6.161 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.115 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.59 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.2.13 - Upgrade
Upgrade
azurelinux/kernelto a version that resolves this vulnerability.Fixed in 6.6.161.1-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.192-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.115-2 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.2.13-1 - Upgrade
Upgrade
debian/linux-6.12to a version that resolves this vulnerability.Fixed in 6.12.115-2~deb12u1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.192-2Fixed in 6.12.117-1Fixed in 7.2.15-1Fixed in 7.3.4-1 - Upgrade
Upgrade
debian/linux-6.12to a version that resolves this vulnerability.Fixed in 6.12.117-1~deb12u1 - Compensating control
In do_tcp_getsockopt(), wrap the ca_ops load and get_info call in rcu_read_lock()/rcu_read_unlock(), and use READ_ONCE() to load the icsk_ca_ops pointer.
Event History
Frequently Asked Questions
Which systems are exposed to this race condition?
The issue affects Linux kernel systems using BPF struct_ops congestion-control implementations, where the congestion-control operations structure can be dynamically allocated and freed while TCP_CC_INFO is queried.
What operation triggers the vulnerable code path?
The vulnerable path is reached when do_tcp_getsockopt() handles the TCP_CC_INFO socket option. A concurrent replacement or removal of the BPF struct_ops congestion-control operations can leave the code dereferencing or calling a stale ca_ops pointer.
How can I determine whether the fix is present?
The corrected code loads icsk_ca_ops with READ_ONCE() and keeps both the ca_ops access and get_info callback invocation inside an RCU read-side critical section using rcu_read_lock() and rcu_read_unlock(). The listed stable kernel references contain the applicable fixes.