CVE-2026-98376: bpf: Use array_map_meta_equal for percpu array inner map replacement
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
bpf: Use array_map_meta_equal for percpu array inner map replacement
percpu_array_map_ops.map_meta_equal points to the generic bpf_map_meta_equal(), which does not compare max_entries. When a percpu array serves as an inner map, replacing it with one that has fewer max_entries bypasses the check. Since percpu_array_map_gen_lookup() inlines the original template's index_mask as a JIT immediate, a lookup on the replacement map can access pptrs[] out of bounds.
Point percpu_array_map_ops.map_meta_equal to array_map_meta_equal(), which already enforces the max_entries equality check.
Add a selftest to verify that replacing a percpu array inner map with a differently-sized one is rejected.
The Linux kernel CVE team has assigned CVE-2026-98376 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.10 with commit db69718b8efac802c7cc20d5a6c7dfc913f99c43 and fixed in 7.1 with commit 593980175389a05793f6060aa20e626330960395
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-98376
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
kernel/bpf/arraymap.c tools/testing/selftests/bpf/prog_tests/percpu_array_inner_map.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/593980175389a05793f6060aa20e626330960395