USENIX Security2025Top-tier venue
Approximation Enforced Execution of Untrusted Linux Kernel Extensions
Hao Sun, Zhendong Su
Abstract
Modern OS kernels allow untrusted extensions, such as eBPF programs, to be dynamically loaded into kernel space, with their safety ensured by an in-kernel verifier. However, this approach implicitly places the entire verifier, a complicated and error-prone component, within the trusted code base. Despite substantial efforts to verify and test the verifier, its complexity and frequent updates continue to introduce soundness bugs, leading to various security issues. This paper introduces Approximation-Enforced Execution (AEE), a novel concept to ensure the safe execution of untrusted kernel extensions, even in the presence of potential verifier bugs. The verifier can be essentially abstracted into two key components: the complex state approximation and the simpler safety check based on the former. By enforcing the program execution to remain within the verifier's approximations, the soundness of state approximation is, by design, not assumed-executions with non-contained states are terminated, thereby significantly reducing the trust base. AEE also leverages the verifier, but mainly obtains the approximations. It then rewrites the program to conduct the approximation enforcement, where trust is established by combining the runtime facts with minimal reliance on the verifier's safety checks. We apply AEE to ensure the spatial memory safety of eBPF programs and formally prove its soundness w.r.t. mitigating the verifier's soundness bugs and completeness w.r.t. ensuring safety under the reduced trust base. Our evaluation shows that our prototype reduces the trusted code base by 4.5x, with an average runtime overhead of 1.2% and an average increase in binary size of 4.8%.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Builds on18
- PAC it up: Towards Pointer Integrity using ARM Pointer AuthenticationHans Liljestrand, Thomas Nyman, Kui Wang, Carlos Chinea Perez et al.USENIX Security 2019 · 168 citations
- XRP: In-Kernel Storage Functions with eBPFYuhong Zhong, Haoyu Li, Yu Jian Wu, Ioannis Zarkadas et al.OSDI 2022 · 100 citations
- Specification and verification in the field: Applying formal methods to BPF just-in-time compilers in the Linux kernelLuke Nelson, Jacob Van Geffen, Emina Torlak, Xi WangOSDI 2020 · 72 citations
- Verifying the Verifier: eBPF Range Analysis VerificationHarishankar Vishwanathan, Matan Shachnai, Srinivas Narayana, Santosh NagarakatteCAV 2023 · 37 citations
- Syrup: User-Defined Scheduling Across the StackKostis Kaffes, Jack Tigar Humphries, David Mazières, Christos KozyrakisSOSP 2021 · 35 citations
Related papers
- SoK: Challenges and Paths Toward Memory Safety for eBPFKaiming Huang, Mathias Payer, Zhiyun Qian, Jack Sampson et al.S&P 2025
- Prove It to the Kernel: Precise Extension Analysis via Proof-Guided Abstraction RefinementHao Sun, Zhendong SuSOSP 2025
- Validating the eBPF Verifier via State EmbeddingHao Sun, Zhendong SuOSDI 2024 · 18 citations
- Finding Correctness Bugs in eBPF Verifier with Structured and Sanitized ProgramHao Sun, Yiru Xu, Jianzhong Liu, Yuheng Shen et al.EuroSys 2024 · 24 citations
- KRAKENGUARD: Towards Fine-Grained eBPF IsolationJainil Patel, Lucas Graeff Buhl-Nielsen, Adrien Ghosn, Marios KogiasNSDI 2026
