HIGH Introduced in 7.1
fprobe RCU UAF
CVE-2026-98861
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: fprobe: Use guard(rcu_sched_notrace) and check rcu_is_watching() unregister_fprobe() and unregister_fprobe_async() (used by BPF kprobe-multi) rely on standard RCU grace periods (synchronize_rcu() and call_rcu()) to wait until in-flight fprobe handlers complete before freeing the fprobe. However, if an fprobe handler executes while RCU is not watching (such as in the idle loop or nohz_full extended quiescent states), standard RCU does not track preemption-disabled sections. Consequently, synchronize_rcu() does not wait for those executions, which can lead to a use-after-free if the fprobe is freed immediately after unregistration. Ensure handlers exit early when !rcu_is_watching(). Furthermore, fprobe_fgraph_entry() and fprobe_ftrace_entry() previously used guard(rcu)() and rcu_read_lock(), which invoke lockdep on every hit under CONFIG_PROVE_LOCKING. This adds overhead and can cause lockdep recursion if probed functions interact with lockdep. Since rhltable_lookup() and rhl_for_each_entry_rcu() use rcu_dereference_all_check() (which checks rcu_read_lock_any_held()), holding preemption disabled via rcu_read_lock_sched_notrace() is fully valid and sufficient so long as rcu_is_watching() is true. Define and use guard(rcu_sched_notrace)() across fprobe_ftrace_entry(), fprobe_fgraph_entry(), and fprobe_return(). This eliminates fast-path rcu_read_lock() and lockdep overhead while guaranteeing safe grace period synchronization.
02KernelScan AI Analysis
Risk summary
A use-after-free in the fprobe tracing subsystem allows a local attacker with CAP_SYS_ADMIN or CAP_BPF to free an fprobe object while handlers are still executing in RCU quiescent states (idle loop or nohz_full). This can lead to arbitrary kernel memory read/write and privilege escalation. The bug is reachable via BPF kprobe-multi or direct fprobe registration.
Vulnerability analysis
The fprobe subsystem uses RCU grace periods to wait for in-flight handlers before freeing an fprobe during unregistration. However, standard RCU does not track preemption-disabled sections when RCU is not watching — such as in the idle loop or nohz_full extended quiescent states. This means synchronize_rcu() can return while a handler is still running, leading to a use-after-free when the fprobe is freed. The fix replaces rcu_read_lock() and guard(rcu)() with guard(rcu_sched_notrace)(), which holds preemption disabled without lockdep overhead, and adds early-exit checks for rcu_is_watching() in all three handler entry points (ftrace entry, fgraph entry, and return). This ensures handlers do not run when RCU cannot track them, closing the grace-period gap. The vulnerability is locally exploitable by any process with CAP_SYS_ADMIN (for tracing) or CAP_BPF (for BPF kprobe-multi), including unprivileged users in a user namespace where those capabilities are mapped.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.18 | 6.18.34 | 6.18.56 | a85d0f00671b |
| 7.0 | 7.0.11 | 7.1 | dd4a0d499363 |
| 7.2 | 7.1 | 7.2.10 | e0a624919040 |
| mainline | 7.1 | 7.3 | — |