KernelScan.io

HIGH Introduced in 6.15

bpf Verifier TypeConfusion

CVE-2026-90312

CVSS 7.8 / 10.0 NVD

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

KernelScan AI8.8HIGH

01

In the Linux kernel, the following vulnerability has been resolved: bpf: Check load-acquire src ptr type before the load check_atomic_load() calls check_load_mem() before atomic_ptr_type_ok(). For a load-acquire that fetches into its own source register (dst_reg == src_reg), check_load_mem() overwrites src_reg's type with the type of the loaded value, so the subsequent atomic_ptr_type_ok() no longer sees the source pointer and fails to reject the disallowed types (ctx, pkt, flow_keys, sock). Since bpf_convert_ctx_accesses() does not rewrite atomic loads, the raw access to the underlying kernel object is left in place. The destination type is taken from the ctx access itself, so a load-acquire of the sk field of struct __sk_buff for example leaves the register typed as PTR_TO_SOCK_COMMON_OR_NULL, which type_is_sk_pointer() does not match either, while it actually holds unconverted struct sk_buff bytes. Once the NULL check has passed this is a type confusion, not just a leak of kernel data. Validate src_reg with check_reg_arg() and check the source pointer type with atomic_ptr_type_ok() before the load again, mirroring check_atomic_rmw(). Out-of-range register numbers are already rejected earlier by check_and_resolve_insns() (commit 503d21ef8eac ("bpf: Do register range validation early")), and the only exemption there, is_stack_arg_ldx(), requires BPF_LDX | BPF_MEM | BPF_DW and thus never matches a BPF_ATOMIC insn. atomic_ptr_type_ok() can therefore not dereference register state out of bounds, that is, the out-of-bounds read addressed by the Fixes commit below does not reappear (as proven also via selftest).

02

Engine v0.6.0

Risk summary

A BPF verifier bug allows a crafted load-acquire instruction to bypass type checks, causing type confusion where a register holds raw kernel object bytes but is typed as a pointer. An attacker who can load BPF programs could exploit this for arbitrary kernel read/write, leading to privilege escalation or container escape.

Affectedkernel/bpf/verifier.c (bpf verifier)

Vulnerability analysis

The BPF verifier validates the source pointer type of a load-acquire instruction too late — after the load has already been processed. When the same register serves as both source and destination, the load operation overwrites the register's type information before the pointer-type check can run. This allows disallowed pointer types to slip through verification. Because atomic loads are not rewritten for context accesses, the generated code performs raw access to the underlying kernel object, while the register receives an incorrect type annotation — for example, appearing as a socket pointer while actually containing raw socket buffer bytes. After a NULL check passes, this mismatch becomes exploitable type confusion capable of arbitrary kernel memory access. The fix validates the source register and its pointer type before processing the load, matching the order already used for other atomic operations. Any process capable of loading BPF programs can reach this path.

03

BranchIntroducedFixed inPatch commit
6.186.156.18.526ee7b0088849
7.26.157.2.6422a41604117
mainline6.157.3b87803391baa