ZeroHour

CVE-2026-89581

mass

Linux kernel x86 BPF JIT per-CPU address bug enables local kernel crash and corruption

CVSS 3.1
7.8 high
EPSS
Published
()
Modified
AI analysis

The x86-64 BPF JIT in the Linux kernel builds the REX prefix for the per-CPU address MOV with add_1mod(), which sets REX.B instead of REX.R, so whenever the destination is an extended register the high register bit is lost and the write lands on the wrong physical register (R5→RAX, R7→RBP, R8→RSI, R9→RDI). A locally loaded BPF program that keeps a per-CPU address in such a register then dereferences a pointer that was never adjusted by the per-CPU base, causing a kernel page fault and panic, while also clobbering RAX, the frame pointer RBP, or argument registers — rated CVSS 7.8 (local, low privileges required, high C/I/A impact). In practice only GCC's BPF backend emits the faulty pattern, because clang reloads the address into R1 before each per-CPU access, which is why the bug went unnoticed for years and only surfaced when kernel selftests were built with BPF_GCC. Any unpatched x86-64 Linux system where a user with BPF-loading privileges (or unprivileged BPF enabled) can load a crafted or GCC-compiled program is affected. No public PoC exists, the issue is not in CISA's KEV, and no exploitation in the wild is known.

What to do: Patch to a kernel carrying the fix (the commit replacing add_1mod() with add_2mod() for the per-CPU address MOV) via your distribution's kernel updates. Keep unprivileged BPF disabled (kernel.unprivileged_bpf_disabled=1, the default on most modern distros) and restrict BPF program loading to trusted users holding CAP_BPF/CAP_SYS_ADMIN. Audit for any GCC-compiled BPF programs in use and treat 'BUG: unable to handle page fault' inside bpf_prog_* on x86-64 as a possible indicator of this flaw.

Affected
Linux kernel (x86-64 BPF JIT)
Estimated exposure
massVulnerable code present in effectively every x86-64 Linux system (on the order of billions of devices/instances), but the crash/corruption path requires… — Linux dominates servers and cloud instances and the x86 BPF JIT ships enabled by default, but only GCC-built (BPF_GCC) programs — rare outside kernel CI and selftests — hit the misencoded destination register.

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

In the Linux kernel, the following vulnerability has been resolved: bpf, x86: Fix per-CPU address resolution into an extended register The destination of the per-CPU address MOV is encoded in ModRM.reg, which is extended by REX.R, but the REX prefix is built with add_1mod(), which sets REX.B. REX.B extends ModRM.rm and SIB.base, and this instruction addresses memory as disp32 with no base, so the bit has no effect at all and the high register bit is simply lost. Every is_ereg() destination therefore resolves to the wrong register, picking whichever one shares the low three bits: R5 -> RAX R7 -> RBP R8 -> RSI R9 -> RDI With BPF_REG_5, whose reg2hex is 0, the emitted 65 49 03 04 25 add %gs: ,%rax adds the per-CPU offset to RAX rather than R8. The destination keeps the unadjusted address and RAX is clobbered, so the program goes on to dereference a pointer that was never made per-CPU: BUG: unable to handle page fault for address: 0000607e386a8894 RIP: bpf_prog_707837aafd2aa9ae_update_percpu_data+0x93/0xc9 Call Trace: __bpf_prog_test_run_raw_tp+0x2dc/0x7d0 __flush_smp_call_function_queue+0x1e9/0xc80 Kernel panic - not syncing: Fatal exception in interrupt R5 is the mildest of the four, aliasing a scratch register and faulting at the store. R7 aliases RBP and would corrupt the frame pointer, R8 and R9 alias the argument registers. Use add_2mod() so the register goes through REX.R, matching how add_2reg() places it in ModRM.reg and how emit_priv_frame_ptr() hardcodes 0x4c for the same instruction with R9. Encodings for the non-extended registers are unchanged. Problem showed up when trying to resurrect BPF_GCC CI (selftests built with BPF_GCC). This has gone unnoticed because clang reloads the address into R1 before each per-CPU access, so the destination is never an extended register. GCC keeps several per-CPU addresses live at once, and test_progs-bpf_gcc panics the kernel in global_percpu_data/init, where the address of a .percpu variable ends up in R5.

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

In the news

No ingested article mentions this CVE yet.