HIGH
bpf RetvalRange Bypass
CVE-2026-72111
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
KernelScan AI8.5HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: bpf: Reset register bounds before narrowing retval range in check_mem_access() When the BPF verifier processes a context load of an LSM hook return value, it calls __mark_reg_s32_range() to narrow the register to the hook's valid range. However, __mark_reg_s32_range() intersects the new range with the register's existing bounds using max_t()/min_t() rather than replacing them. If the destination register carries stale bounds from a prior instruction (e.g. BPF_MOV64_IMM), the intersection can produce a range narrower than reality. The verifier then believes it knows the register's exact value, while at runtime the actual hook return value is loaded, creating a verifier/runtime mismatch that can be used to bypass BPF memory safety checks. The else branch already calls mark_reg_unknown() to reset register state before any narrowing. Apply the same reset in the is_retval path so stale bounds are cleared before __mark_reg_s32_range() intersects.
02KernelScan AI Analysis
Risk summary
A BPF verifier logic error allows a crafted program to bypass memory safety checks and gain arbitrary kernel read/write access. This is exploitable by any user who can load BPF programs, including unprivileged users on systems with unprivileged BPF enabled, enabling container or namespace escape. The impact includes kernel code execution, data theft, and system crash.
Vulnerability analysis
The BPF verifier fails to reset register bounds before narrowing a register to the valid range of an LSM hook return value. When a register carries stale bounds from a prior instruction, the narrowing operation intersects with those stale bounds, producing a range tighter than reality. The verifier then trusts this incorrect range, allowing a crafted BPF program to bypass memory safety checks and gain out-of-bounds read or write access to kernel memory at runtime. The fix clears the register state before applying the narrowing, matching the behavior already used in other code paths. This vulnerability is reachable by any user who can load a BPF program — on systems with unprivileged BPF enabled, that includes unprivileged local users and container workloads; on systems with unprivileged BPF disabled, it requires CAP_BPF in the init namespace.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.10 | 6.10.13 | 6.11 | bde92f65042e |
| 6.11 | 6.11.2 | 6.12 | 0993dc5fc619 |
| 6.12 | — | 6.12.103 | 5a55f9aecc08 |
| 7.1 | — | 7.1.5 | — |
| mainline | — | 7.2-rc1 | — |
| 6.18 | — | 6.18.40 | 5e0b273e0a62 |