HIGH Introduced in 5.12
bpf Trampoline UAF
CVE-2026-98800
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: bpf: Wait for an RCU tasks grace period before freeing trampoline progs When a prog is detached from a trampoline, it is freed after an RCU grace period, or an RCU tasks trace one if it is sleepable. This covers the tasks that are running the prog, since the prog's enter helper takes the matching read lock before the prog is called. On a preemptible kernel, it doesn't cover a task that was preempted in the trampoline just before the enter helper. That task holds no lock yet, and it calls the prog after it was freed: BUG: KASAN: vmalloc-out-of-bounds in __bpf_prog_enter_recur+0x3a5/0x3f0 Read of size 8 at addr ffffc90000055040 by task candidate/110 CPU: 1 UID: 0 PID: 110 Comm: candidate Not tainted 7.3.0-rc2-00014-g15071f2a1263-dirty #2 PREEMPT(full) Call Trace: <TASK> __bpf_prog_enter_recur+0x3a5/0x3f0 bpf_trampoline_6442509193+0x37/0xf1 __x64_sys_futex+0x9/0x410 do_syscall_64+0xb0/0x530 ... Wait for an RCU tasks grace period before the existing one when freeing a prog that was linked to a trampoline. An RCU tasks grace period only ends once the tasks that were preempted have run again, and bpf_tramp_image_put() already relies on it to free the image. It doesn't wait for tasks that sleep in the trampoline, the next commit takes care of those. Only progs that were linked to a trampoline can be called this way, so bpf_trampoline_add_prog() marks them and other progs are still freed as before.
02KernelScan AI Analysis
Risk summary
A local attacker with CAP_BPF can trigger a use-after-free in the BPF trampoline subsystem on preemptible kernels, leading to kernel memory corruption, privilege escalation, or denial of service. The vulnerability is reachable when a BPF program attached to a trampoline is detached while a task is preempted in the trampoline entry code.
Vulnerability analysis
When a BPF program is detached from a trampoline, the kernel frees it after an RCU grace period. On a preemptible kernel, a task can be preempted inside the trampoline just before the program's enter helper acquires its RCU read lock. That task holds no lock, and when it resumes it calls the already-freed program, causing a use-after-free. The fix marks programs that were ever linked to a trampoline and, for those programs, inserts an additional RCU tasks grace period before the existing RCU wait. An RCU tasks grace period only ends once all preempted tasks have run again, closing the race window. Only programs attached to trampolines are affected; other BPF programs continue to use the original freeing path.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 5.10 | 5.10.28 | 5.11 | 40955f6512a0 |
| 5.11 | 5.11.11 | 5.12 | 0fb5751a6e41 |
| 7.2 | 5.12 | 7.2.10 | — |
| mainline | 5.12 | 7.3 | — |
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.118-cip136) |
| 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) |