bitVakt

Kernel Kit / Infix / v26.10.0latest

CVE-2026-98376

7.8high

linux6.18.60 · 6.18.54 · 6.18.8 · 6.12.21in 4 of 4 releases

Not yet analysed by NVD. Matched on the vendor's record; this may change when NVD has analysed it.

Reach linux · 8 builds in 4 of 4 releases

full reviewcross-check✓ a member decided

Description · NVD

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.

Published 2026-10-09NVD

CVSS 3.1Local · low privileges · no user interaction

How it is reached

Attack vector
Local
Attack complexity
Low
Privileges required
Low
User interaction
None

What it costs

Confidentiality
High
Integrity
High
Availability
High
Scope
Unchanged

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

References 1
Review Av26.10.0aarch64_minimalNot exposedFable 5.2 · medium confidence · 2026-11-19

The fix is not in this tree: percpu_array_map_ops.map_meta_equal still points to the generic bpf_map_meta_equal() in kernel/bpf/arraymap.c, and the file is compiled with CONFIG_BPF_SYSCALL=y, CONFIG_BPF_JIT=y and CONFIG_SMP=y on arm64, where the inlined per-CPU lookup is active. The build is therefore affected.

Reaching the bug requires creating a map-in-map with a per-CPU array inner map and loading a BPF program through the bpf() syscall. With CONFIG_BPF_UNPRIV_DEFAULT_OFF=y that needs CAP_BPF or CAP_SYS_ADMIN in the initial user namespace. I found no component in board/, src/ or package/ that loads eBPF programs or relaxes unprivileged_bpf_disabled, and no YANG node or CLI command that does so.

This is case (c): an attacker would need a root shell (or an equivalently privileged process) on the device to load a crafted BPF program. It is not reachable from a network interface.

Evidence 12
  1. `percpu_array_map_ops` sets `.map_meta_equal = bpf_map_meta_equal`, the pre-fix state; the fix changes this to `array_map_meta_equal`.

    output/build/linux-6.18.60/kernel/bpf/arraymap.c:820-821

  2. `array_map_meta_equal()` (the `max_entries` check) exists but is used only by `array_map_ops` at line 795.

    output/build/linux-6.18.60/kernel/bpf/arraymap.c:585-592

  3. `percpu_array_map_gen_lookup()` inlines `map->max_entries` and `array->index_mask` as immediates when the JIT supports per-CPU instructions.

    output/build/linux-6.18.60/kernel/bpf/arraymap.c:265-294

  4. `bpf_jit_supports_percpu_insn()` returns true on arm64, so the inlined lookup is used on this target.

    output/build/linux-6.18.60/arch/arm64/net/bpf_jit_comp.c:3083-3086

  5. `CONFIG_BPF_SYSCALL=y`, `CONFIG_BPF_JIT=y`, `CONFIG_BPF_JIT_DEFAULT_ON=y`, and `CONFIG_BPF_UNPRIV_DEFAULT_OFF=y` (unprivileged `bpf()` is disabled by default).

    output/build/linux-6.18.60/.config:100-104

  6. `CONFIG_SMP=y`.

    output/build/linux-6.18.60/.config:303

  7. `kernel/bpf/arraymap.o` was built.

    output/objects.txt:18932

  8. The source is 6.18.60 with no extra version suffix.

    output/build/linux-6.18.60/Makefile:2-4

  9. No applied patch has `bpf` in its name, so there is no local backport of the fix.

    output/build/linux-6.18.60/.applied_patches_list

  10. No `percpu_array_inner_map.c` selftest, consistent with the fix commit being absent.

    output/build/linux-6.18.60/tools/testing/selftests/bpf/prog_tests/

  11. The only hits are `CONFIG_BPF_JIT=y` in the kernel defconfigs (e.g. `board/aarch64/linux_defconfig:7`); no product component loads eBPF programs or changes the `unprivileged_bpf_disabled` sysctl.

    board/, src/, package/ (rg for unprivileged_bpf, bpftool, libbpf, ebpf, .bpf.c)

  12. Only the `BR2_PACKAGE_BPFTOOL_ARCH_SUPPORTS` / `BR2_PACKAGE_BPFTRACE_ARCH_SUPPORTS` capability symbols are set; no bpftool, bpftrace or libbpf package is selected.

    output/.config:619-621

Version and patches

The tree is plain 6.18.60 and still contains the vulnerable assignment at kernel/bpf/arraymap.c:821. None of the 139 applied patches touches BPF by name. I could not read the upstream fix commit 593980175389 (no network access), so the first fixed 6.18.y release is not confirmed here; it is later than 6.18.60.

Recommendation

No urgent action is needed: exploitation requires root or CAP_BPF on the device, which already implies full control. Document it as not exposed and pick up the fix with the next routine 6.18.y stable bump that includes commit 593980175389. The fix is a one-line change (.map_meta_equal = array_map_meta_equal in percpu_array_map_ops) and is trivial to backport if a bump is delayed.

Open questions

I did not check whether other Infix defconfigs (non-minimal) ship container support. A container granted CAP_BPF or CAP_SYS_ADMIN in the initial user namespace, or run privileged, could reach the code; this defconfig shows no BR2_PACKAGE_PODMAN.

The search for BPF users covered board/, src/ and package/ by keyword only. I did not inspect the iproute2 build to see whether its BPF loader (tc ... bpf) is compiled in; that path would also need root.

The upstream commit and the exact fixed stable version could not be checked from this tree.

Members of Kernel Kit decide. Sign in if you are one.