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-98038 Overview
CVE-2026-98038 is a Linux kernel vulnerability in the Berkeley Packet Filter (BPF) subsystem. The verifier incorrectly classifies certain RCU-protected loads of local kptrs as owning references. This allows bpf_refcount_acquire() to return NULL while the verifier treats the result as non-NULL, producing a null pointer dereference condition in BPF programs that manipulate reference-counted objects within RCU critical sections.
Critical Impact
BPF programs can trigger a null pointer dereference when a borrowed RCU kptr reaches a zero refcount, leading to kernel instability or potential local privilege escalation on systems where unprivileged BPF is available.
Affected Products
- Linux kernel (upstream)
- Linux distributions shipping the affected BPF verifier logic
- Systems with BPF programs that use bpf_refcount_acquire() on RCU-protected local kptrs
Discovery Timeline
- 2026-09-25 - CVE-2026-98038 published to NVD
- 2026-09-25 - Last updated in NVD database
Technical Details for CVE-2026-98038
Vulnerability Analysis
The vulnerability resides in the BPF verifier's reference-tracking logic for reference-counted kernel pointers (kptrs). The function bpf_refcount_acquire() is fallible for borrowed references because the underlying object may have already reached a zero refcount. The verifier correctly preserves the KF_RET_NULL flag on the return value unless the argument is treated as an owning reference.
An RCU-protected load of a local kptr is marked MEM_ALLOC, but it only receives NON_OWN_REF when the pointee contains a graph node. A refcounted object without a graph node therefore appears to the verifier as an owning reference. The loaded register has no acquired reference state. The verifier then skips the required NULL check on the return value of bpf_refcount_acquire().
When a BPF program drops the last real reference while remaining inside the RCU critical section, refcount_inc_not_zero() returns NULL. The verifier assumes the returned pointer is non-NULL and permits dereferences, resulting in a kernel null pointer dereference.
Root Cause
The root cause is a classification error in the BPF verifier. It treats refcounted objects without graph nodes as owning references purely because they are not tagged NON_OWN_REF. The verifier should classify an argument as owning only when it is backed by a verifier-tracked reference, such as pointers from bpf_obj_new(), bpf_kptr_xchg(), or an earlier successful acquisition.
Attack Vector
A local user with the ability to load BPF programs can craft a program that loads an RCU-protected refcounted kptr without a graph node. The program then calls bpf_refcount_acquire() and dereferences the returned pointer without a NULL check. By racing the release of the last reference inside the RCU section, the attacker triggers the NULL dereference. See the upstream fix in Linux Kernel Commit 85074498 and Linux Kernel Commit dc36739e for technical details.
Detection Methods for CVE-2026-98038
Indicators of Compromise
- Unexpected kernel oops or panic messages referencing bpf_refcount_acquire in the call trace.
- Loading of unsigned or unexpected BPF programs by non-root users with CAP_BPF.
- Repeated verifier acceptance of programs that acquire refcounts on RCU-loaded kptrs without subsequent NULL checks.
Detection Strategies
- Audit kernel version strings across the fleet to identify hosts running vulnerable BPF verifier code.
- Monitor dmesg and /var/log/kern.log for null pointer dereference oops traces originating in BPF helpers.
- Track bpf() syscall activity, especially BPF_PROG_LOAD operations from unprivileged or non-standard processes.
Monitoring Recommendations
- Enable kernel audit rules for bpf() syscall invocations and correlate with process lineage.
- Collect kernel crash dumps and symbolicate stack traces for any oops containing BPF reference helpers.
- Alert on new or unsigned eBPF program loads originating from workloads that do not normally use BPF.
How to Mitigate CVE-2026-98038
Immediate Actions Required
- Apply the upstream Linux kernel patches referenced in Linux Kernel Commit 85074498 and Linux Kernel Commit dc36739e.
- Update to a distribution kernel that incorporates the fix once vendors publish backports.
- Restrict CAP_BPF and CAP_SYS_ADMIN to trusted administrative accounts only.
Patch Information
The fix modifies the BPF verifier to classify an argument to bpf_refcount_acquire() as owning only when it is backed by a verifier-tracked reference. This preserves the non-NULL return guarantee for pointers from bpf_obj_new(), bpf_kptr_xchg(), or a prior successful acquisition. It forces a NULL check for borrowed RCU kptrs. Apply the upstream commits or the equivalent vendor backport.
Workarounds
- Set kernel.unprivileged_bpf_disabled=1 via sysctl to prevent unprivileged users from loading BPF programs.
- Use Linux Security Modules such as SELinux or AppArmor to restrict bpf() syscall access to approved processes.
- Disable or remove BPF program loaders that are not required for production workloads.
# Configuration example
sysctl -w kernel.unprivileged_bpf_disabled=1
echo 'kernel.unprivileged_bpf_disabled=1' > /etc/sysctl.d/99-disable-unpriv-bpf.conf
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

