HIGH Introduced in 6.2
bpf MemAlloc OOB
CVE-2026-93148
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI8.7HIGH
01Description
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.
02KernelScan AI Analysis
Risk summary
A BPF verifier bug allows programs with CAP_BPF to read or write past the bounds of objects allocated via bpf_obj_new, because the verifier incorrectly applies flexible-array size relaxation to statically-sized MEM_ALLOC objects. This can lead to kernel heap corruption, information disclosure, or privilege escalation. Any system that allows untrusted or containerized users to load BPF programs is at risk.
Vulnerability analysis
The BPF verifier's logic for checking struct access sizes treats structs with a trailing flexible array as potentially larger than their static definition. This is correct for ordinary kernel data structures, but objects allocated through bpf_obj_new have exactly the static size — there is no extra memory for a flexible array. A BPF program referencing such an object could therefore read or write past the allocation into adjacent kernel heap memory, leading to corruption or information leaks. The fix ensures that for these specifically allocated objects, the verifier does not apply the flexible-array relaxation and rejects accesses that extend past the object's declared size. Loading a BPF program that triggers this requires CAP_BPF; on systems where user namespaces grant that capability to unprivileged users, a local attacker can exploit the flaw.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| mainline | 6.2 | 7.3-rc1 | 9c9ee0324c77 |
| 7.2 | 6.2 | 7.2.6 | e626a50d07d4 |