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-98134 Overview
CVE-2026-98134 is a Linux kernel vulnerability in the Berkeley Packet Filter (BPF) verifier. The verifier incorrectly infers that a pointer is non-null when two pointers of different types are compared. The flaw resides in check_cond_jmp_op(), which strips the PTR_MAYBE_NULL flag based solely on type inspection. Pointer types such as PTR_TO_MEM | MEM_RDONLY | PTR_UNTRUSTED lack PTR_MAYBE_NULL yet may still be null at runtime. A BPF program comparing such a pointer to a map lookup result can bypass the verifier's null-dereference checks.
Critical Impact
BPF programs loaded by unprivileged or restricted users could dereference null pointers in kernel context, enabling potential denial of service or further kernel memory corruption.
Affected Products
- Linux kernel versions containing the vulnerable check_cond_jmp_op() BPF verifier logic
- Distributions shipping the affected mainline kernel BPF subsystem
- Systems that permit loading of BPF programs by non-root users
Discovery Timeline
- Vulnerability reported by Nicholas Carlini
- 2026-09-25 - CVE-2026-98134 published to NVD
- 2026-09-30 - Last updated in NVD database
Technical Details for CVE-2026-98134
Vulnerability Analysis
The BPF verifier performs static analysis on programs before they execute in kernel context. One optimization in check_cond_jmp_op() handles comparisons of the form rA == rB. When either register's type lacks the PTR_MAYBE_NULL flag, the verifier assumes neither pointer can be null and strips that flag from the other register. This allows subsequent dereferences without null checks.
The assumption is incorrect for pointer types where absence of PTR_MAYBE_NULL does not guarantee a non-null value. Types such as PTR_TO_MEM with MEM_RDONLY | PTR_UNTRUSTED flags, returned by helpers like bpf_rdonly_cast(), can hold zero at runtime despite lacking the null-maybe marker.
Root Cause
The root cause is an overly broad use of type_may_be_null() within the comparison logic. The function returns false for any type lacking PTR_MAYBE_NULL, but this does not imply the value is guaranteed non-null. The patch replaces the check with reg_not_null(), which maintains an explicit allowlist of pointer types whose absence of PTR_MAYBE_NULL truly guarantees non-null status at runtime.
Attack Vector
An attacker loads a crafted BPF program that calls bpf_rdonly_cast(0, 0) to obtain a pointer with value zero but without the PTR_MAYBE_NULL flag. The program then performs bpf_map_lookup_elem() to obtain a PTR_TO_MAP_VALUE | PTR_MAYBE_NULL pointer. Comparing the two pointers for equality causes the verifier to strip the null-maybe flag from the map value register. The subsequent dereference writes to a null address in kernel context. See the kernel commit b55c9f0 and commit d3ef6c0 for technical details.
Detection Methods for CVE-2026-98134
Indicators of Compromise
- Unexpected kernel oops or panic messages referencing BPF program execution and null pointer dereference
- Load events for BPF programs that call bpf_rdonly_cast() followed by comparisons against map lookup results
- Kernel crash logs with faulting instruction pointers in BPF JIT-compiled regions
Detection Strategies
- Audit bpf() syscall usage for unprivileged processes attempting to load programs using bpf_rdonly_cast kfunc
- Monitor kernel ring buffer messages for BPF verifier anomalies and runtime null dereferences
- Inspect BPF program bytecode in loaded objects for suspicious pointer comparison patterns
Monitoring Recommendations
- Enable auditd rules for the bpf syscall to log program load operations with user and command context
- Collect /sys/kernel/debug/tracing/ events related to BPF program lifecycle where available
- Forward kernel logs to a centralized logging platform for correlation of BPF load events with subsequent crashes
How to Mitigate CVE-2026-98134
Immediate Actions Required
- Update to a Linux kernel release containing the fix referenced in commit d3ef6c0
- Restrict BPF program loading to privileged users by setting kernel.unprivileged_bpf_disabled=1
- Review and inventory systems that permit unprivileged BPF usage
Patch Information
The fix replaces the type_may_be_null() call in check_cond_jmp_op() with reg_not_null(), which uses an explicit allowlist of pointer types. The allowlist is extended to include PTR_TO_XDP_SOCK and PTR_TO_BUF to preserve backward compatibility with existing selftests such as verifier_jeq_infer_not_null/null_ptr_to_map_value. Patches are available in commit b55c9f0 and commit d3ef6c0.
Workarounds
- Disable unprivileged BPF by writing 1 to /proc/sys/kernel/unprivileged_bpf_disabled
- Apply seccomp or Linux Security Module policies to deny the bpf() syscall for untrusted workloads
- Remove or restrict access to kfuncs such as bpf_rdonly_cast through kernel configuration where feasible
# Configuration example
sysctl -w kernel.unprivileged_bpf_disabled=1
echo 'kernel.unprivileged_bpf_disabled=1' >> /etc/sysctl.d/90-bpf-hardening.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

