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-98800 Overview
CVE-2026-98800 is a use-after-free vulnerability in the Linux kernel's Berkeley Packet Filter (BPF) trampoline subsystem. When a BPF program is detached from a trampoline, the kernel waits for a Read-Copy-Update (RCU) grace period before freeing it. On preemptible kernels, a task preempted inside the trampoline before acquiring the enter helper's read lock holds no reference. That task resumes and calls the already-freed program, triggering an out-of-bounds read in __bpf_prog_enter_recur. Kernel Address Sanitizer (KASAN) reports confirm the condition. The fix adds an RCU tasks grace period before freeing trampoline-linked programs.
Critical Impact
A preempted task can invoke a freed BPF program, producing a kernel use-after-free that may lead to memory corruption or local privilege escalation on preemptible Linux kernels.
Affected Products
- Linux kernel builds configured with PREEMPT(full) and BPF trampoline support
- Development branch kernel 7.3.0-rc2 and related pre-release trees referenced in the KASAN trace
- Stable branches containing the vulnerable BPF trampoline detach path prior to commits 0fb5751 and 40955f6
Discovery Timeline
- 2026-10-18 - CVE-2026-98800 published to NVD
- 2026-10-19 - Last updated in NVD database
Technical Details for CVE-2026-98800
Vulnerability Analysis
The flaw resides in the lifecycle management of BPF programs attached to trampolines. The kernel relies on __bpf_prog_enter_recur to take a protective read lock before executing the program. Detach paths wait on an RCU grace period, or an RCU tasks trace grace period for sleepable programs, to ensure no in-flight callers remain before freeing the program memory.
On a fully preemptible kernel, a task can be scheduled out inside the trampoline assembly stub immediately before the enter helper acquires the lock. The standard RCU grace period does not account for this task because it holds no RCU read-side critical section at that instant. When the task is rescheduled, it jumps into the enter helper and dereferences the freed program structure, producing a vmalloc out-of-bounds read reported by KASAN.
Root Cause
The root cause is a missed synchronization window between trampoline entry and lock acquisition. The existing grace-period logic covers executing callers but not preempted-but-not-yet-executing callers. This is a classic use-after-free pattern caused by incomplete tracking of in-flight consumers of a freed object.
Attack Vector
Exploitation requires local code execution with the ability to load or trigger BPF trampoline programs, typically through tracing, fentry, or fexit attachments. A local attacker can race program detachment against a thread preempted inside the trampoline to force a dereference of freed memory. See the upstream fix at Kernel Git Commit 0fb5751 and Kernel Git Commit 40955f6 for the detailed code path.
Detection Methods for CVE-2026-98800
Indicators of Compromise
- KASAN kernel log entries containing BUG: KASAN: vmalloc-out-of-bounds in __bpf_prog_enter_recur
- Kernel oops or panic stack traces referencing bpf_trampoline_ symbols followed by syscall entry frames
- Unexpected process crashes on hosts with heavy BPF tracing workloads under preemptible kernels
Detection Strategies
- Enable KASAN on test and canary kernels to surface use-after-free conditions in the BPF trampoline path
- Audit systems running custom or third-party BPF programs using bpftool prog show and correlate with kernel version
- Monitor dmesg and the systemd journal for BPF-related warnings on kernels built with CONFIG_PREEMPT=y
Monitoring Recommendations
- Centralize kernel log collection and alert on KASAN and __bpf_prog_enter_recur strings
- Track which users and workloads load BPF programs via audit rules on the bpf() syscall
- Review scheduler and preemption configuration across the fleet to identify exposed hosts
How to Mitigate CVE-2026-98800
Immediate Actions Required
- Apply the upstream Linux kernel patches referenced in commits 0fb5751 and 40955f6 as soon as they land in your distribution's stable tree
- Inventory hosts with CONFIG_PREEMPT=y or PREEMPT(full) kernels running BPF tracing agents and prioritize them for patching
- Restrict CAP_BPF and CAP_SYS_ADMIN to trusted service accounts to limit who can attach trampoline programs
Patch Information
The fix adds an RCU tasks grace period before the existing one when freeing a program linked to a trampoline. An RCU tasks grace period only ends after preempted tasks have been rescheduled, closing the race. bpf_trampoline_add_prog() marks trampoline-linked programs so unrelated programs continue to use the original free path. Refer to Kernel Git Commit 0fb5751 and Kernel Git Commit 40955f6.
Workarounds
- Disable or unload non-essential BPF tracing programs on preemptible kernels until patches are applied
- Where feasible, deploy non-preemptible (CONFIG_PREEMPT_NONE or voluntary preemption) kernels for workloads that heavily use BPF trampolines
- Enforce least privilege on BPF capabilities using sysctl kernel.unprivileged_bpf_disabled=1
# Configuration example
sysctl -w kernel.unprivileged_bpf_disabled=1
auditctl -a always,exit -F arch=b64 -S bpf -k bpf_syscall
bpftool prog show
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

