Skip to main content
Vulnerability Database/CVE-2026-98037

CVE-2026-98037: Linux Kernel Use-After-Free Vulnerability

CVE-2026-98037 is a use-after-free vulnerability in the Linux kernel's BPF subsystem affecting untrusted allocated-object pointers. This article covers the technical details, security implications, and mitigation strategies.

Published:

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-98037 Overview

CVE-2026-98037 is a Linux kernel vulnerability in the Berkeley Packet Filter (BPF) subsystem. The verifier incorrectly treats demoted local kernel pointers (kptrs) as live allocated objects. After the final Read-Copy-Update (RCU) read-side critical section ends, a local kptr becomes PTR_UNTRUSTED but keeps its MEM_ALLOC flag. The helper type_is_ptr_alloc_obj() still accepts these pointers, which may be NULL or reference freed memory. A BPF program can then pass such pointers to kernel functions (kfuncs) like bpf_refcount_acquire(), leading to NULL or stale pointer dereference inside the kernel.

Critical Impact

A loaded BPF program can trigger kernel dereference of NULL or freed memory, enabling denial of service and potentially memory corruption on affected Linux kernels.

Affected Products

  • Linux kernel versions implementing BPF local kptrs with refcount support
  • Distributions shipping affected mainline and stable kernel branches
  • Systems that permit unprivileged or privileged BPF program loading

Discovery Timeline

  • 2026-09-25 - CVE CVE-2026-98037 published to NVD
  • 2026-09-25 - Last updated in NVD database

Technical Details for CVE-2026-98037

Vulnerability Analysis

The flaw resides in the BPF verifier's type tracking for allocated-object pointers. The Linux kernel's BPF subsystem supports local kptrs, which are heap-allocated objects managed through refcounting and RCU protection. When the final RCU grace period for a local kptr elapses, the verifier demotes the pointer type by adding the PTR_UNTRUSTED flag. The pointer may now be NULL or point to memory whose lifetime guarantees no longer hold.

The predicate type_is_ptr_alloc_obj() evaluates any PTR_TO_BTF_ID carrying the MEM_ALLOC flag as a live allocated object. It does not check for the PTR_UNTRUSTED flag. A refcount-only local kptr never acquires NON_OWN_REF, so the demoted pointer still satisfies the argument validation for bpf_refcount_acquire() and similar graph kfuncs.

Root Cause

The root cause is incomplete predicate logic in BPF verifier type analysis. type_is_ptr_alloc_obj() treats MEM_ALLOC as sufficient evidence of a live object without disqualifying pointers that have been demoted to PTR_UNTRUSTED. Because type_is_non_owning_ref() builds on the same predicate, graph kfunc arguments inherit the same gap. The verifier therefore accepts arguments that reference objects beyond their protected lifetime.

Attack Vector

Exploitation requires the ability to load a BPF program on the target system. A crafted program obtains a refcount-only local kptr, allows the governing RCU read-side critical section to end, and then passes the demoted pointer to bpf_refcount_acquire() or a similar kfunc. The kernel dereferences a NULL or stale pointer during the operation. Successful exploitation can crash the kernel or, depending on allocator state, enable use-after-free primitives.

The vulnerability is described in the kernel commit messages referenced below. No public proof-of-concept has been published. See the Kernel Git Commit 092c287 for the fix and verifier logic details.

Detection Methods for CVE-2026-98037

Indicators of Compromise

  • Unexpected kernel oops or panic entries referencing bpf_refcount_acquire or BPF verifier frames in dmesg and /var/log/kern.log
  • Kernel NULL pointer dereference reports originating from BPF kfunc call sites
  • Loading of untrusted or newly introduced BPF programs that exercise local kptrs and refcounting kfuncs

Detection Strategies

  • Audit BPF program loads using bpftool prog list and compare against an approved program inventory
  • Enable kernel audit rules for bpf() syscalls and review BTF-ID usage in loaded programs
  • Correlate kernel crash telemetry with BPF subsystem activity across hosts to identify repeat offenders

Monitoring Recommendations

  • Forward kernel ring buffer and audit logs to a centralized analytics platform for cross-host correlation
  • Alert on non-root processes invoking the bpf() syscall with BPF_PROG_LOAD where unprivileged BPF is enabled
  • Track kernel version drift across the fleet to prioritize unpatched hosts for remediation

How to Mitigate CVE-2026-98037

Immediate Actions Required

  • Apply the upstream Linux kernel patches referenced in the fix commits as soon as vendor builds are available
  • Restrict BPF program loading to privileged users by setting kernel.unprivileged_bpf_disabled=1
  • Inventory hosts running BPF-based tooling and prioritize kernels that expose local kptr features

Patch Information

The fix updates type_is_ptr_alloc_obj() to reject PTR_UNTRUSTED pointers, which also closes the gap for type_is_non_owning_ref(). Fault-protected reads of the demoted pointer remain valid because writes are already rejected and read fixups use bpf_may_fault_on_deref(). Review and apply the upstream commits: Kernel Git Commit 092c287, Kernel Git Commit 135d542, Kernel Git Commit 6b1f786, and Kernel Git Commit 7441ee8.

Workarounds

  • Disable unprivileged BPF program loading at runtime and at boot via sysctl configuration
  • Remove or restrict the CAP_BPF and CAP_SYS_ADMIN capabilities from workloads that do not require BPF
  • Use seccomp or Linux Security Module policies to block the bpf() syscall for untrusted containers and services
bash
# Configuration example: disable unprivileged BPF persistently
echo 'kernel.unprivileged_bpf_disabled=1' | sudo tee /etc/sysctl.d/90-disable-unpriv-bpf.conf
sudo sysctl --system

# Verify the setting
sysctl kernel.unprivileged_bpf_disabled

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

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.