HIGH Introduced in 5.6
tcp CongestionOps UAF
CVE-2026-99139
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
01Description
In the Linux kernel, the following vulnerability has been resolved: tcp: fix use-after-free in do_tcp_getsockopt(TCP_CONGESTION) do_tcp_getsockopt() reads icsk->icsk_ca_ops->name without holding rcu_read_lock(). Since commit 0baf26b0fcd7 ("bpf: tcp: Support tcp_congestion_ops in bpf"), icsk_ca_ops can point to dynamically allocated BPF struct_ops memory that may be freed concurrently via setsockopt(TCP_CONGESTION), leading to a use-after-free. BUG: KASAN: slab-use-after-free in _copy_to_user+0x37/0x60 Read of size 16 at addr ffff888013505260 by task exploit/149 _copy_to_user+0x37/0x60 do_tcp_getsockopt+0x158a/0x2460 (net/ipv4/tcp.c:4585) tcp_getsockopt+0x91/0xf0 __sys_getsockopt+0xf7/0x170 Fix this by holding rcu_read_lock() around the ca_ops->name access, using READ_ONCE() to load icsk_ca_ops, and copying the name to a stack buffer before releasing the lock. Also annotate the relevant icsk_ca_ops stores with WRITE_ONCE() to fix the accompanying KCSAN data-race issue.
02KernelScan AI Analysis
Risk summary
A local user can trigger a use-after-free in the TCP congestion control subsystem by racing getsockopt(TCP_CONGESTION) against setsockopt(TCP_CONGESTION) when a BPF-based congestion control algorithm is loaded. This allows privilege escalation to kernel level and container escape.
Vulnerability analysis
The TCP getsockopt handler for TCP_CONGESTION reads the congestion control algorithm's name from a pointer (icsk_ca_ops) without RCU protection. Since BPF congestion control support was added, this pointer can reference dynamically allocated memory that is freed when the congestion control is changed via setsockopt. A local attacker with two threads can race the read against the free, causing a use-after-free that leads to arbitrary kernel memory read/write and privilege escalation. The fix wraps the pointer access in rcu_read_lock(), uses READ_ONCE/WRITE_ONCE for proper memory ordering, and copies the name to a stack buffer before releasing the lock. Any local user who can create TCP sockets can trigger this once a BPF congestion control module is loaded (typically by an administrator).
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.1 | 5.6 | 6.1.191 | a60e62705c17 |
| 6.12 | 5.6 | 6.12.115 | 08dc5c62c096 |
| 6.18 | 5.6 | 6.18.59 | c1804ef01639 |
| 6.6 | 5.6 | 6.6.161 | 4b0930d66dde |
| 7.2 | 5.6 | 7.2.13 | a8e45471afa2 |
| mainline | 5.6 | 7.3 | 5271b79b7ad6 |
04CIP Kernels
State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.
| CIP tree | State |
|---|---|
| cip/6.12 | Affected — no CIP fix yet (latest 6.12.114-cip34) |
| cip/6.1 | Affected — no CIP fix yet (latest 6.1.190-cip62) |
| cip/6.1-rt | Affected — no CIP fix yet (latest 6.1.189-cip61-rt32) |
| cip/5.10 | Affected — no CIP fix yet (latest 5.10.272-cip79) |
| cip/5.10-rt | Affected — no CIP fix yet (latest 5.10.272-cip79-rt35) |