MOAT: Towards Safe BPF Kernel Extension
Hongyi Lu, Shuai Wang, Yechang Wu, Wanning He, Fengwei Zhang
摘要
The Linux kernel extensively uses the Berkeley Packet Filter (BPF) to allow user-written BPF applications to execute in the kernel space. The BPF employs a verifier to check the security of user-supplied BPF code statically. Recent attacks show that BPF programs can evade security checks and gain unauthorized access to kernel memory, indicating that the verification process is not flawless. In this paper, we present MOAT, a system that isolates potentially malicious BPF programs using Intel Memory Protection Keys (MPK). Enforcing BPF program isolation with MPK is not straightforward; MOAT is designed to alleviate technical obstacles, such as limited hardware keys and the need to protect a wide variety of BPF helper functions. We implement MOAT on Linux (ver. 6.1.38), and our evaluation shows that MOAT delivers low-cost isolation of BPF programs under mainstream use cases, such as isolating a BPF packet filter with only 3% throughput loss.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 9 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- SoK: Challenges and Paths Toward Memory Safety for eBPF 引用了 HIVE: A Hardware-assisted Isolated Execution Environment for eBPF on AArch64
- SoK: Challenges and Paths Toward Memory Safety for eBPF 引用了 Specification and verification in the field: Applying formal methods to BPF just-in-time compilers in the Linux kernel
- Selective On-Device Execution of Data-Dependent Read I/Os 引用了 XRP: In-Kernel Storage Functions with eBPF
- HIVE: A Hardware-assisted Isolated Execution Environment for eBPF on AArch64 引用了 XRP: In-Kernel Storage Functions with eBPF
- Rex: Closing the language-verifier gap with safe and usable kernel extensions 引用了 HIVE: A Hardware-assisted Isolated Execution Environment for eBPF on AArch64
- Rex: Closing the language-verifier gap with safe and usable kernel extensions 引用了 XRP: In-Kernel Storage Functions with eBPF
- Rex: Closing the language-verifier gap with safe and usable kernel extensions 引用了 Specification and verification in the field: Applying formal methods to BPF just-in-time compilers in the Linux kernel
- Revealing the Unstable Foundations of eBPF-Based Kernel Extensions 引用了 XRP: In-Kernel Storage Functions with eBPF
- Revealing the Unstable Foundations of eBPF-Based Kernel Extensions 引用了 Specification and verification in the field: Applying formal methods to BPF just-in-time compilers in the Linux kernel
引用它的顶会 Paper9
- Rex: Closing the language-verifier gap with safe and usable kernel extensionsJinghao Jia, Ruowen Qin, Milo Craun, Egor Lukiyanov 等USENIX ATC 2025 · 11 次引用
- HIVE: A Hardware-assisted Isolated Execution Environment for eBPF on AArch64Peihua Zhang, Chenggang Wu, Xiangyu Meng, Yinqian Zhang 等USENIX Security 2024 · 8 次引用
- Revealing the Unstable Foundations of eBPF-Based Kernel ExtensionsShawn Wanxiang Zhong, Jing Liu, Andrea C. Arpaci-Dusseau, Remzi H. Arpaci-DusseauEuroSys 2025 · 4 次引用
- Selective On-Device Execution of Data-Dependent Read I/OsChanyoung Park, Minu Chung, Hyungon MoonFAST 2025 · 2 次引用
- SoK: Challenges and Paths Toward Memory Safety for eBPFKaiming Huang, Mathias Payer, Zhiyun Qian, Jack Sampson 等S&P 2025
它引用的 Paper12
- ERIM: Secure, Efficient In-process Isolation with Protection Keys (MPK)Anjo Vahldiek-Oberwagner, Eslam Elnikety, Nuno O. Duarte, Michael Sammler 等USENIX Security 2019 · 247 次引用
- SKEE: A lightweight Secure Kernel-level Execution Environment for ARMAhmed M. Azab, Kirk Swidowski, Rohan Bhutkar, Jia Ma 等NDSS 2016 · 105 次引用
- XRP: In-Kernel Storage Functions with eBPFYuhong Zhong, Haoyu Li, Yu Jian Wu, Ioannis Zarkadas 等OSDI 2022 · 100 次引用
- 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 次引用
- SoK: Practical Foundations for Software Spectre DefensesSunjay Cauligi, Craig Disselkoen, Daniel Moghimi, Gilles Barthe 等S&P 2022 · 59 次引用
相关 Paper
- Extending Applications Safely and EfficientlyYusheng Zheng, Tong Yu, Yiwei Yang, Yanpeng Hu 等OSDI 2025 · 7 次引用
- EPF: Evil Packet FilterDi Jin, Vaggelis Atlidakis, Vasileios P. KemerlisUSENIX ATC 2023 · 14 次引用
- End-to-End Mechanized Proof of a JIT-Accelerated eBPF Virtual Machine for IoTShenghao Yuan, Frédéric Besson, Jean-Pierre TalpinCAV 2024 · 18 次引用
- VEP: A Two-stage Verification Toolchain for Full eBPF ProgrammabilityXiwei Wu, Yueyang Feng, Tianyi Huang, Xiaoyang Lu 等NSDI 2025 · 8 次引用
- Synthesizing safe and efficient kernel extensions for packet processingQiongwen Xu, Michael D. Wong, Tanvi Wagle, Srinivas Narayana 等SIGCOMM 2021 · 30 次引用
