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-98039 Overview
CVE-2026-98039 is a type confusion vulnerability in the Linux kernel's Berkeley Packet Filter (BPF) subsystem. The flaw resides in map_kptr_match_type(), which incorrectly permits plain bpf_obj_new() allocations and referenced kernel pointers to be stored into __percpu_kptr map fields. Because loads from such fields are always marked MEM_PERCPU, downstream consumers treat the stored value as a per-CPU cookie returned by bpf_percpu_obj_new().
Critical Impact
A local attacker with the ability to load BPF programs can achieve arbitrary kernel memory read/write or trigger invalid address relocation through missing destructors.
Affected Products
- Linux kernel BPF subsystem (upstream)
- Stable kernel branches referenced by the four fix commits
- Distributions shipping kernels with BPF_KPTR_PERCPU support prior to the patch
Discovery Timeline
- 2026-09-25 - CVE-2026-98039 published to the National Vulnerability Database
- 2026-09-25 - Last updated in NVD database
Technical Details for CVE-2026-98039
Vulnerability Analysis
The vulnerability is a type confusion flaw in the BPF verifier's kernel pointer (kptr) handling logic. The function map_kptr_match_type() validates whether a source register's type flags are compatible with the destination kptr field. For BPF_KPTR_PERCPU fields, the verifier adds MEM_PERCPU to the permitted flag set, but does not require the source register to actually carry the MEM_PERCPU flag.
The subset test accepts non-per-CPU allocations as valid stores into __percpu_kptr fields. Later, loads from these fields are unconditionally tagged MEM_PERCPU, so per-CPU helpers and map teardown logic treat the stored pointer as a per-CPU cookie returned by bpf_percpu_obj_new(). This mismatch between stored and assumed object type is the root of the memory safety break.
Root Cause
The root cause is an overly permissive flag subset check in map_kptr_match_type(). The permissions mask includes MEM_PERCPU to allow legitimate per-CPU stores, but the check does not enforce that the source register was produced by bpf_percpu_obj_new(). Both program-BTF (bpf_obj_new()) and kernel-BTF (referenced kernel pointer) sources pass validation.
Attack Vector
An attacker who can load a BPF program crafts a map containing a __percpu_kptr field. The program stores a plain bpf_obj_new() allocation or a referenced kernel pointer into that field. On subsequent load, the value is treated as a per-CPU pointer and relocated by per-CPU helpers, yielding an arbitrary kernel read/write primitive. Alternatively, map teardown invokes the per-CPU free path on a non-per-CPU object, causing use of an invalid address or a missing destructor path.
The vulnerability is not demonstrated with public exploit code at this time. Refer to the upstream commits 048029b, 0bdd612, aaa9cf7, and ad4ebae for the full fix.
Detection Methods for CVE-2026-98039
Indicators of Compromise
- Unexpected kernel oops or panic logs referencing per-CPU allocator paths or BPF map teardown.
- Unprivileged or lightly-privileged processes loading BPF programs that declare __percpu_kptr fields in maps.
- Kernel memory corruption traces where the faulting address resembles a per-CPU relocated pointer.
Detection Strategies
- Audit kernel versions across the fleet and flag hosts running pre-patch stable branches referenced by the fix commits.
- Monitor bpf() syscall usage with eBPF or auditd rules, focusing on BPF_PROG_LOAD and BPF_MAP_CREATE operations from non-root contexts.
- Review loaded BPF program BTF for map value types that declare per-CPU kptr fields alongside non-per-CPU allocations.
Monitoring Recommendations
- Enable kernel audit logging for the bpf syscall and ship events to a central analytics pipeline.
- Alert on repeated BPF verifier rejections or anomalous program loads from unexpected service accounts.
- Correlate kernel crash telemetry with BPF program load events on the same host within a short time window.
How to Mitigate CVE-2026-98039
Immediate Actions Required
- Apply the upstream kernel patches from commits 048029b, 0bdd612, aaa9cf7, and ad4ebae or install the vendor kernel update that incorporates them.
- Restrict CAP_BPF and CAP_SYS_ADMIN to trusted service accounts only; disable unprivileged BPF via kernel.unprivileged_bpf_disabled=1.
- Inventory workloads that rely on BPF_KPTR_PERCPU and schedule prioritized reboots after patching.
Patch Information
The fix enforces that the source register's MEM_PERCPU flag matches the destination field kind in map_kptr_match_type(). This preserves valid bpf_percpu_obj_new() stores while rejecting both program-BTF and kernel-BTF variants that lack MEM_PERCPU. The patch is distributed across stable branches via commits 048029b, 0bdd612, aaa9cf7, and ad4ebae.
Workarounds
- Set kernel.unprivileged_bpf_disabled=1 via sysctl to prevent unprivileged BPF program loading.
- Use Linux Security Modules (SELinux, AppArmor) to restrict which binaries can invoke the bpf() syscall.
- Remove or restrict CAP_BPF from container workloads and non-essential service accounts until patching completes.
# Disable unprivileged BPF program loading
sudo sysctl -w kernel.unprivileged_bpf_disabled=1
echo 'kernel.unprivileged_bpf_disabled=1' | sudo tee /etc/sysctl.d/90-bpf-hardening.conf
# Verify current kernel version against patched 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

