KernelScan.io

HIGH Introduced in 6.9

bpf RbtreeCallback Bypass

CVE-2026-98047

CVSS 8.6 / 10.0 KernelScan AI

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

01

In the Linux kernel, the following vulnerability has been resolved: bpf: Check ancestor frames for rbtree callbacks bpf_rbtree_add() invokes its comparator while the caller holds the root lock. The native insertion code retains raw parent and link pointers across the callback, so the verifier prohibits unlocking, consuming tree nodes, or changing RCU state from that callback. in_rbtree_lock_required_cb() only checks the innermost verifier frame. Static subprogram calls are permitted while holding a spin lock, and such a call pushes a frame without in_callback_fn set. Consequently, all callback restrictions disappear in the nested frame. The subprogram can unlock the tree, remove and drop the node being compared, then relock. Native insertion resumes with the stale parent pointer and links freed memory into the tree. Walk all active frames for the rbtree callback instead. Benign static subprograms remain permitted, while callback restrictions follow execution into nested frames.

02

Engine v0.6.0

Risk summary

A BPF verifier bypass allows a local attacker who can load BPF programs to achieve kernel memory corruption by exploiting missing callback-restriction enforcement across nested subprogram frames. The resulting use-after-free can lead to privilege escalation, arbitrary kernel read/write, or kernel panics. Systems permitting unprivileged or container-based BPF program loading are at highest risk.

Affectedkernel/bpf/verifier.c (bpf)

Vulnerability analysis

The BPF verifier checks only the innermost call frame when deciding whether code is executing inside an rbtree comparator callback that holds restrictions on unlocking, freeing nodes, or changing RCU state. When a BPF program calls a static subprogram from within such a callback, the nested frame is not marked as being in a callback context, so all restrictions disappear in that frame. A malicious program can unlock the rbtree, free the node being compared, and relock — while the native insertion code retains stale parent and link pointers, causing freed memory to be linked into the tree. The fix walks all ancestor frames to determine whether any enclosing frame is an rbtree callback, ensuring that callback restrictions follow execution into nested subprograms. This vulnerability is reachable locally by any process able to load BPF programs, which requires CAP_BPF on most distributions.

03

BranchIntroducedFixed inPatch commit
6.126.96.12.114252e9b476af7
6.186.96.18.53b545fa447e09
7.26.97.2.72410cb2ac041
mainline6.97.3369f4ce73457

04

State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.

CIP treeState
cip/6.12Affected — no CIP fix yet (latest 6.12.112-cip33)