When BPF Blinding Goes Dark: Smuggling Raw Gadgets into the Linux Kernel (ON-DEMAND ONLY)

No ratings

Presented at Black Hat USA 2026 by

bpf_jit_harden=2 is supposed to be the last word on JIT spray in the Linux kernel. Every immediate value in a BPF program gets masked with a random XOR key before the JIT ever sees it. Attacker-controlled bytes cannot land in kernel executable memory. The defense has been in place since 2016 and, until now, it worked.When BPF arena support landed in Linux 6.9, the verifier gained the ability to rewrite arena store instructions into a new encoding: BPF_PROBE_MEM32. That instruction carries a 32-bit immediate. The constant blinding pass has a switch statement that dispatches on instruction type. BPF_PROBE_MEM32 is not in it. The blinding pass silently does nothing. The immediate goes straight to the JIT and lands verbatim in kernel executable pages — attacker-controlled bytes, in kernel executable memory, with hardening set to maximum. This has been true on every kernel since 6.9, released March 2024.Three things make this technically significant beyond the missing case. First, no compiler ever emits the vulnerable instruction form. Clang and GCC both decompose constant stores into MOV+STX sequences that get blinded normally. The only way to reach the bug is to know the BPF ISA well enough to patch bytecode by hand after compilation — a trivial step for an attacker, but one that makes the bug invisible to every fuzzer and compiler-driven test in the ecosystem. Second, the obvious one-line fix is wrong: the BPF_STX_MEM() macro silently strips PROBE_MEM32 mode bits, so the patch compiles, CI passes, and the gap remains. Third, the blinding switch is fail-open by design. As the BPF instruction set continues to grow, the same pattern will keep producing gaps in exactly the situations where new instruction types are added quickly and the security pass is the last thing anyone updates.The Briefing covers the full BPF compilation pipeline, the bytecode patching technique needed to trigger the bug, x86-64 gadget geometry from controlled 4-byte immediates at predictable offsets, and a structural argument for why the fix needs to be architectural, not additive.Available on-demand to Briefings Pass Holders via the Black Hat Events App on August 14-September 14.