Detecting Empty Abstractions and Pruning Dead Paths in the Linux eBPF Verifier with Abstract Step Functions
Harishankar Vishwanatha, Srinivas Narayana, Santosh Nagarakatte
Abstract
The Linux kernel's eBPF verifier uses abstract interpretation to ensure the safety of user-provided programs before execution. It tracks each register with multiple interval domains and a bitwise domain (tristate numbers). Refining the abstract state at conditional branches can produce mutually contradictory constraints across domains, indicating an unreachable path. However, the verifier lacks an empty-set () representation and cannot detect when these domains have an empty intersection, causing it to analyze dead paths. Passing such contradictory states into domain reduction or downstream operators violates their implicit non-emptiness precondition, triggering domain invariant violations. This has been a multi-year issue in the Linux kernel causing production outages, false rejections, and state explosion. This paper presents a sound and complete constant-time emptiness check across the eBPF verifier's abstract domains to prune dead branches. We introduce abstract step functions, a general framework that tests whether intervals and non-convex domains intersect in O(1) time without scanning individual values. We develop tnumstep, a formally verified constant-time operator that jumps to the next integer satisfying a tristate bitmask. Using tnumstep, we design a multi-domain emptiness check that detects contradictory states during branch refinement and immediately prunes unreachable branches, eliminating the root cause of dead-branch invariant violations. Our technique prevents invariant violations, state explosion, and false rejections while incurring negligible (1.48%) overhead across Linux kernel selftests and production suites such as Cilium. Our tnumstep operator has been upstreamed into the mainline Linux kernel.
Create a lesson
Related papers
Verified Implementation of the Next-gen Borrow Checking Algorithm for Rust via Abstract Interpretation
Shared title terminology · Jinhua Wu, Yuting Wang, Zhemin Chen
Validating Concurrent Correctness Witnesses with Ghosts by Thread-Modular Abstract Interpretation
Shared title terminology · Michael Schwarz, Zhendong Ang, Umang Mathur
Statically Typed Purely Functional Definitional Interpreters for Essentials of Programming Languages
Shared title terminology · Kwanghoon Choi
CompCert4Lean: Porting a Verified C Compiler to Lean in Six Weeks with Parallel Coding Agents
Shared title terminology · Cong Wang, Zhiyang Chen, Fan Long et al.
A Nonlinear Abstract Domain for Bayesian Neural Networks
Shared title terminology · Qiuhan Gu, Gagandeep Singh
DeCompCert: A Verified Decompiler for CompCert-Generated AArch64
Shared title terminology · Swarn Priya, Basavesh Ammanaghatta Shivakumar, Thomas Gilray et al.