CVE-2026-93148: bpf: Reject MEM_ALLOC BTF accesses past object bounds
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
bpf: Reject MEM_ALLOC BTF accesses past object bounds
BTF struct walks relax the struct-size check for accesses through a trailing flexible array. That is valid for ordinary BTF type walking, but PTR_TO_BTF_ID | MEM_ALLOC values point to objects allocated with the static BTF type size.
When walking a MEM_ALLOC object, reject the access before applying the flexible-array relaxation if the access range extends past the struct size. Apply the same policy to struct ID matching so kfunc and kptr type checks do not walk past the allocated object bounds either.
The Linux kernel CVE team has assigned CVE-2026-93148 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.2 with commit 958cf2e273f0929c66169e0788031310e8118722 and fixed in 7.2.6 with commit e626a50d07d43421cbf7bfb5a084b33a5e276b6e Issue introduced in 6.2 with commit 958cf2e273f0929c66169e0788031310e8118722 and fixed in 7.3-rc1 with commit 9c9ee0324c774490ae953162aaaf4561d222bd93
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-93148
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:
include/linux/bpf.h
kernel/bpf/btf.c
kernel/bpf/verifier.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/e626a50d07d43421cbf7bfb5a084b33a5e276b6e https://git.kernel.org/stable/c/9c9ee0324c774490ae953162aaaf4561d222bd93