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

CVE-2026-98150: Linux Kernel BPF Privilege Escalation Flaw

CVE-2026-98150 is a privilege escalation vulnerability in the Linux kernel BPF subsystem caused by improper CPU ID validation. This flaw can lead to kernel paging requests and system instability. This article covers technical details, affected versions, impact assessment, 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-98150 Overview

CVE-2026-98150 is a Linux kernel vulnerability in the Berkeley Packet Filter (BPF) subsystem. The flaw affects bpf_map_check_op_flags(), which validates the BPF_F_CPU flag used in per-CPU map operations. The function compares the caller-supplied CPU ID against num_possible_cpus() instead of validating against actual CPU IDs. On systems with sparse CPU topologies, such as arm64 QEMU guests with device-tree holes, the check accepts non-existent CPU IDs. A local user invoking bpf() syscalls on a BPF_MAP_TYPE_PERCPU_ARRAY can trigger a kernel paging fault at an invalid virtual address.

Critical Impact

Local, low-privilege callers can trigger kernel memory corruption and system crashes on affected arm64 and sparse-CPU Linux hosts through crafted BPF map operations.

Affected Products

  • Linux kernel versions containing the BPF_F_CPU flag implementation in bpf_map_check_op_flags()
  • Systems with sparse CPU topologies (arm64 QEMU guests, platforms with CPU device-tree holes)
  • BPF_MAP_TYPE_PERCPU_ARRAY and other per-CPU BPF map consumers

Discovery Timeline

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

Technical Details for CVE-2026-98150

Vulnerability Analysis

The BPF_F_CPU flag stores a target CPU ID in the upper 32 bits of the BPF map operation flags. When a userspace program issues a bpf() syscall with this flag set, the kernel validates the embedded CPU ID before dispatching the operation to per-CPU map handlers such as bpf_percpu_array_update(). The validation path in bpf_map_check_op_flags() relied on num_possible_cpus(), which returns the count of possible CPUs rather than an upper bound on CPU IDs. These two values diverge on systems where the possible CPU mask is non-contiguous.

On an arm64 QEMU guest with a possible CPU mask of 0,2-3, num_possible_cpus() returns 3. The old check accepted CPU ID 1 (which does not exist) and rejected CPU ID 3 (which does) with -ERANGE. Accepting CPU ID 1 drove the update into the per-CPU access path, where pointer arithmetic produced an invalid address and the kernel issued a paging request that __pi_memcpy_generic could not satisfy. The resulting crash occurs in bpf_map_update_value → map_update_elem → __sys_bpf. This is a kernel-level input validation flaw with memory safety consequences.

Root Cause

The validation logic conflated CPU count with CPU ID range. num_possible_cpus() returns the population count of the possible CPU mask; it does not bound the highest valid CPU ID. On systems with contiguous CPU IDs starting from zero, the two values coincide, which hid the defect. On sparse topologies, the check is both over-permissive and under-permissive.

Attack Vector

An attacker requires local access and the ability to invoke the bpf() syscall. Standard distributions restrict bpf() to privileged users via kernel.unprivileged_bpf_disabled, but containerized workloads, debugging tools, and specific CAP_BPF-granted processes retain access. The attacker allocates a BPF_MAP_TYPE_PERCPU_ARRAY, encodes an out-of-range or absent CPU ID in the upper 32 bits of the flags argument, and issues BPF_MAP_UPDATE_ELEM. The resulting kernel paging fault denies service to the host and, depending on surrounding memory layout, may enable further exploitation primitives.

No verified public exploit code is available. The upstream commits bdc5941f and ed54bf5 replace the faulty comparison with checks against nr_cpu_ids and cpu_possible().

Detection Methods for CVE-2026-98150

Indicators of Compromise

  • Kernel oops entries referencing __pi_memcpy_generic with bpf_percpu_array_update in the call trace
  • Unable to handle kernel paging request messages originating from the __sys_bpf → map_update_elem path
  • Unexpected process termination or host reboots on arm64 systems with sparse /sys/devices/system/cpu/possible masks

Detection Strategies

  • Audit bpf() syscall telemetry for calls carrying non-zero upper 32 bits in the flags argument against per-CPU map types
  • Correlate kernel ring buffer crashes with recent BPF map creation events from the same process ancestry
  • Monitor hosts where /sys/devices/system/cpu/possible reports non-contiguous ranges for anomalous BPF activity

Monitoring Recommendations

  • Enable auditd rules on the bpf syscall and forward kernel logs to a centralized collector for crash pattern analysis
  • Track processes that hold CAP_BPF or CAP_SYS_ADMIN and establish a baseline for legitimate BPF map operations
  • Alert on repeated -ERANGE returns from bpf() followed by kernel paging faults within short time windows

How to Mitigate CVE-2026-98150

Immediate Actions Required

  • Apply kernel updates that include commits bdc5941f and ed54bf5
  • Set kernel.unprivileged_bpf_disabled=1 on systems that do not require unprivileged BPF access
  • Restrict CAP_BPF and CAP_SYS_ADMIN grants to vetted workloads only

Patch Information

The upstream fix replaces the num_possible_cpus() comparison with validation against nr_cpu_ids combined with cpu_possible(). This rejects CPU IDs outside the valid range and CPU IDs absent from the possible mask, while allowing valid sparse IDs. Distribution maintainers should backport both referenced commits to supported stable branches. Rebuild and reboot affected kernels after applying the patch.

Workarounds

  • Disable unprivileged BPF via sysctl -w kernel.unprivileged_bpf_disabled=1 until the patch is applied
  • Avoid deploying workloads that create per-CPU BPF maps on hosts with sparse CPU topologies
  • Use seccomp profiles in container runtimes to block the bpf syscall for untrusted workloads
bash
# Configuration example
sysctl -w kernel.unprivileged_bpf_disabled=1
echo 'kernel.unprivileged_bpf_disabled=1' >> /etc/sysctl.d/90-bpf-hardening.conf

# Verify CPU topology to assess exposure
cat /sys/devices/system/cpu/possible

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.