Formalizing the Linux eBPF Core ISA: A Mechanized Operational Semantics and Its Real-World Applications
Shenghao Yuan, Yazhou Tang, Tianci Cao, Frédéric Besson, Jean-Pierre Talpin, Mingshuai Chen
Key points
From the paper's conclusion- We develop a small-step semantics in Rocq that faithfully formalizes all 153 sequential in-kernel instructions of the eBPF ISA.
Abstract
This paper presents a mechanized formal semantics for the Linux eBPF instruction set architecture (ISA). We develop a small-step semantics in Rocq that faithfully formalizes all 153 sequential in-kernel instructions of the eBPF ISA. The semantics is fully executable and has been validated against the official Linux eBPF test suite. This extensive testing revealed inconsistencies in our original formalization. Using this semantics, we have designed, implemented, and verified the soundness of the bit-level abstract domain employed by the Linux eBPF verifier. Our semantics also complements the existing Linux eBPF documentation by providing a rigorous formal specification. During the formalization process, we have discovered previously unknown bugs in the Linux eBPF implementation, and developed new verifier optimizations; the corresponding kernel patches have been upstreamed.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Keel: A Verified In-Kernel Proof Checker for Proof Carrying BPFarXiv · 2026
- Detecting Empty Abstractions and Pruning Dead Paths in the Linux eBPF Verifier with Abstract Step FunctionsarXiv · 2026
- Extending concurrent separation logic to the hardware level to verify the xv6 OS kernel on RISC-V with AI agentsarXiv · 2026
- KernelArmor: End-to-End Agentic System for Establishing Memory and Thread Safety for CUDAarXiv · 2026
- SafeJIT: A Speculating JIT Engine Verified Down to the Machine CodearXiv · 2026
- Sound State Encodings in Translational Separation Logic VerifiersProceedings of the ACM on Programming Languages · 2026