Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-98047 Overview
CVE-2026-98047 is a Linux kernel vulnerability in the Berkeley Packet Filter (BPF) verifier. The flaw affects how bpf_rbtree_add() validates callback restrictions when a static subprogram is called while a spin lock is held. The verifier only inspected the innermost frame, allowing nested subprograms to bypass callback restrictions, unlock the tree, free the node under comparison, and relock. Native insertion then resumes with a stale parent pointer and links freed memory into the red-black tree, resulting in a use-after-free condition inside the kernel.
Critical Impact
A local attacker with the ability to load BPF programs can corrupt kernel memory through a use-after-free in rbtree insertion, potentially leading to privilege escalation.
Affected Products
- Linux kernel branches containing the bpf_rbtree_add() callback logic
- Distributions shipping affected stable kernel versions prior to the referenced fix commits
- Systems that permit unprivileged or privileged BPF program loading with rbtree helpers
Discovery Timeline
- 2026-09-25 - CVE-2026-98047 published to NVD
- 2026-09-25 - Last updated in NVD database
Technical Details for CVE-2026-98047
Vulnerability Analysis
The vulnerability resides in the BPF verifier logic that enforces callback restrictions for bpf_rbtree_add(). The native insertion path holds raw parent and link pointers across the comparator callback invocation while the root lock is held. To preserve memory safety, the verifier must prohibit unlocking the tree, consuming nodes, or changing RCU state inside that callback.
The helper in_rbtree_lock_required_cb() only inspected the innermost verifier frame. Static subprogram calls are permitted while holding a spin lock, and each such call pushes a new frame without the in_callback_fn flag set. As a result, callback restrictions silently disappeared in nested frames.
An attacker-controlled subprogram executed from the comparator can therefore unlock the rbtree, remove and drop the node currently being compared, and relock the tree. When native insertion resumes, it dereferences the stale parent pointer and links freed memory into the tree structure, producing a use-after-free that corrupts kernel data structures.
Root Cause
The root cause is incomplete verifier state tracking across call frames. Callback-scope restrictions were evaluated against a single frame instead of walking the full active frame stack. The fix walks all active frames when determining whether rbtree callback restrictions apply, so nested static subprograms inherit the restrictions of the enclosing callback.
Attack Vector
Exploitation requires the ability to load a BPF program that uses bpf_rbtree_add(). The crafted program defines a comparator that invokes a static subprogram, which in turn drops the spin lock, removes the node under comparison, releases its memory, and reacquires the lock. The kernel then operates on freed memory during tree linkage, yielding memory corruption primitives useful for local privilege escalation.
No verified public exploit code is available. Refer to the upstream commits for the fix implementation: Kernel Git Commit Fix, Kernel Git Commit Update, and Kernel Git Commit Change.
Detection Methods for CVE-2026-98047
Indicators of Compromise
- Unexpected kernel oops or BUG: KASAN: use-after-free messages referencing bpf_rbtree_add or rbtree insertion paths.
- Loading of BPF programs by non-root users or containers that reference rbtree helpers combined with static subprogram calls under spin locks.
- Kernel panics occurring shortly after BPF program load events in /var/log/kern.log or dmesg.
Detection Strategies
- Audit bpf() syscalls through auditd rules and correlate program loads with subsequent kernel memory faults.
- Monitor for BPF programs that combine bpf_rbtree_add, bpf_spin_unlock, and bpf_obj_drop helpers within callback-reachable subprograms.
- Enable CONFIG_DEBUG_INFO_BTF and verifier logging on sensitive hosts to capture program structure for post-incident review.
Monitoring Recommendations
- Collect bpf() syscall telemetry and kernel ring buffer output into a central data lake for correlation across hosts.
- Alert on kernel panics, KASAN reports, or soft-lockups occurring within short windows of BPF program loads.
- Track installed kernel versions across the fleet and flag hosts running kernels that predate the referenced fix commits.
How to Mitigate CVE-2026-98047
Immediate Actions Required
- Apply the stable kernel update containing commit 369f4ce734570bdfedaa4b5ca50e2a3f6a892728 or your distribution's backport.
- Restrict bpf() syscall access to trusted administrators by setting kernel.unprivileged_bpf_disabled=1.
- Audit containers and workloads that require CAP_BPF or CAP_SYS_ADMIN and remove the capability where it is not required.
Patch Information
The fix walks all active verifier frames when evaluating rbtree callback restrictions, closing the gap that allowed nested static subprograms to escape callback constraints. Patches are available in the upstream stable tree: Kernel Git Commit Fix, Kernel Git Commit Update, and Kernel Git Commit Change. Rebuild and reboot affected hosts after applying the update.
Workarounds
- Disable unprivileged BPF program loading via the kernel.unprivileged_bpf_disabled sysctl.
- Remove CAP_BPF and CAP_SYS_ADMIN from containers and service accounts that do not require BPF program loading.
- Enforce seccomp or Linux Security Module policies that block the bpf() syscall for workloads with no legitimate need.
# Disable unprivileged BPF program loading
sysctl -w kernel.unprivileged_bpf_disabled=1
echo 'kernel.unprivileged_bpf_disabled=1' >> /etc/sysctl.d/90-bpf-hardening.conf
# Verify kernel version against fixed commits
uname -r
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

