CVE-2026-98150

bpf: Fix BPF_F_CPU validation for sparse CPU IDs

Published Sep 25, 2026 CVSS 3.1 · 7 High EPSS < 1% KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

bpf: Fix BPF_F_CPU validation for sparse CPU IDs

BPF_F_CPU stores the target CPU ID in the upper 32 bits of the map
operation flags. bpf_map_check_op_flags() currently compares that ID
with num_possible_cpus(), which is the number of possible CPUs rather
than a bound on CPU IDs.

On an arm64 QEMU guest with a CPU device-tree hole, the possible CPU
mask was 0,2-3. A userspace program using raw bpf() syscalls creates
a BPF_MAP_TYPE_PERCPU_ARRAY and performs update and lookup operations
for each CPU by setting BPF_F_CPU and the CPU ID in the flags.

With the old check, CPU 1 is incorrectly accepted while valid CPU 3 is
rejected with -ERANGE. The CPU 1 update then reaches the per-CPU map
access path and triggers:

Unable to handle kernel paging request at virtual address ...
pc : __pi_memcpy_generic+0x5c/0x22c
lr : bpf_percpu_array_update+0x2dc/0x2e8
Call trace:
__pi_memcpy_generic
bpf_map_update_value
map_update_elem
__sys_bpf

Check the CPU ID against nr_cpu_ids and cpu_possible() instead. This
rejects CPU IDs outside the valid range and CPUs absent from the
possible mask, while allowing valid sparse CPU IDs.

Analysis

AI-generated

Technical impact

The vulnerability lies in the way the Linux kernel validates a target CPU identifier supplied in the BPF_F_CPU flag of eBPF BPF_MAP_TYPE_PERCPU_ARRAY operations. The kernel compared this identifier against the total number of possible CPUs rather than the actual range of valid CPU IDs, allowing an out-of-range CPU ID to slip through. When such an invalid CPU ID reaches the per‑CPU map update path, the kernel attempts a memory copy that dereferences an invalid address, causing a kernel panic. The effect is a denial of service that occurs when an invalid CPU ID is passed to the per‑CPU map update. The underlying flaw is an out‑of‑bounds memory write, identified as CWE‑787. The CVE data does not state whether elevated privileges are required; based on the description it is inferred that a process capable of issuing such a bpf() call could trigger the crash.

Affected Systems

All Linux kernel releases that implement eBPF map updates with the BPF_F_CPU flag are affected, with the risk most pronounced on arm64 architectures or virtualized environments where CPU IDs are non‑contiguous (e.g., QEMU guests with a device‑tree hole). Kernel builds before the commit that introduced the fix are vulnerable; current stable kernels that include the patch are no longer impacted.

Risk and Exploitability

The CVSS score of 7 indicates significant impact, and the EPSS score is <1%, indicating a very low but non-zero exploitation probability. The issue is not listed in CISA KEV, and the crash can potentially be triggered by a user who can invoke bpf() calls; however, the CVE data does not specify whether elevated privileges are required, so based on the description it is inferred that a process capable of crafting a BPF map operation with an out‑of-range CPU ID could cause the crash. This is a classic buffer overflow (CWE‑787). No public exploit is documented, but the required attack vector is simply supplying an out‑of-range CPU ID in a map operation.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the kernel update that includes the BPF_F_CPU validation fix (commit bdc5941f6eeef90b76a07fd8ca38ac1933ba2195), which corrects the out‑of‑bounds memory write identified as CWE‑787.
  • If a patch cannot be applied immediately, restrict eBPF usage to users with privileged access by removing CAP_SYS_ADMIN from untrusted accounts or by placing a stricter seccomp filter on bpf() system calls.
  • Validate CPU identifiers in user space, ensuring they fall within the nr_cpu_ids range and are reported by cpu_possible(), before constructing BPF map operations that use the BPF_F_CPU flag.

Generated by OpenCVE AI on October 23, 2026 at 07:48 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Ubuntu USN Ubuntu USN USN-9019-1 Linux kernel (Azure) vulnerabilities
Ubuntu USN Ubuntu USN USN-9020-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-9160-1 Linux kernel (Azure) vulnerabilities
History
Type Values Removed Values Added
Weaknesses CWE-20
Type Values Removed Values Added
Weaknesses NVD-CWE-noinfo
CPEs cpe:2.3:o:linux:linux_kernel:7.3:rc1:*:*:*:*:*:*
Type Values Removed Values Added
Weaknesses CWE-20
CWE-787
Type Values Removed Values Added
Weaknesses CWE-190
CWE-404
Type Values Removed Values Added
Metrics cvssV3_1

{'score': 7, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H'}

Type Values Removed Values Added
Weaknesses CWE-190
CWE-404
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: bpf: Fix BPF_F_CPU validation for sparse CPU IDs BPF_F_CPU stores the target CPU ID in the upper 32 bits of the map operation flags. bpf_map_check_op_flags() currently compares that ID with num_possible_cpus(), which is the number of possible CPUs rather than a bound on CPU IDs. On an arm64 QEMU guest with a CPU device-tree hole, the possible CPU mask was 0,2-3. A userspace program using raw bpf() syscalls creates a BPF_MAP_TYPE_PERCPU_ARRAY and performs update and lookup operations for each CPU by setting BPF_F_CPU and the CPU ID in the flags. With the old check, CPU 1 is incorrectly accepted while valid CPU 3 is rejected with -ERANGE. The CPU 1 update then reaches the per-CPU map access path and triggers: Unable to handle kernel paging request at virtual address ... pc : __pi_memcpy_generic+0x5c/0x22c lr : bpf_percpu_array_update+0x2dc/0x2e8 Call trace: __pi_memcpy_generic bpf_map_update_value map_update_elem __sys_bpf Check the CPU ID against nr_cpu_ids and cpu_possible() instead. This rejects CPU IDs outside the valid range and CPUs absent from the possible mask, while allowing valid sparse CPU IDs.
Title bpf: Fix BPF_F_CPU validation for sparse CPU IDs
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Oct 19, 2026, 9:14 AM
Reserved
Sep 25, 2026, 10:25 AM
Status
Analyzed
Published
Sep 25, 2026, 11:17 AM
Modified
Oct 21, 2026, 8:24 PM
Severity
Moderate
Public date
Sep 25, 2026, 12:00 AM