KRAKENGUARD: Towards Fine-Grained eBPF Isolation
Jainil Patel, Lucas Graeff Buhl-Nielsen, Adrien Ghosn, Marios Kogias
摘要
eBPF is a powerful in-kernel virtual machine that enables dynamic, safe extensions to operating system kernels. Despite the guarantees provided by its in-kernel verifier, eBPF's access control model remains coarse-grained, relying on broad Linux capabilities, such as CAP_BPF. Once granted, these allow unrestricted loading of eBPF programs to different kernel hooks. This poses serious security risks in multi-tenant or untrusted environments, where a compromised or malicious process can misuse eBPF to trace sensitive activity, access kernel memory, or disrupt system behavior. While existing verification ensures safety properties, it cannot enforce finegrained constraints on what programs can do.
We present KRAKENGUARD, a trusted user-space manager that enforces fine-grained, policy-driven constraints on eBPF bytecode at load time. Using symbolic execution, it checks all program paths for compliance with policies on helper usage, memory accesses, and return values. It enables safe delegation of program loading by unprivileged processes and detects cross-program interference to ensure safe co-location of eBPF programs on the same host.
We show that KRAKENGUARD can block the misuse of restricted helpers, unauthorized memory and map access, and unsafe packet modifications in real-world eBPF programs, while also being able to detect existing CVEs. As a use case, we implement an XDP-as-a-Service application that securely runs XDP programs belonging to different tenants directly on the host interface after guaranteeing they cannot do anything malicious and that they do not interfere with each other.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 1 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Verifying the Verifier: eBPF Range Analysis Verification 引用了 Specification and verification in the field: Applying formal methods to BPF just-in-time compilers in the Linux kernel
- Electrode: Accelerating Distributed Protocols with eBPF 引用了 BMC: Accelerating Memcached using Safe In-kernel Caching and Pre-stack Processing
- Virtualizing eBPF with Late-Binding 引用了 BMC: Accelerating Memcached using Safe In-kernel Caching and Pre-stack Processing
- Virtualizing eBPF with Late-Binding 引用了 Electrode: Accelerating Distributed Protocols with eBPF
- Virtualizing eBPF with Late-Binding 引用了 Specification and verification in the field: Applying formal methods to BPF just-in-time compilers in the Linux kernel
引用它的顶会 Paper1
它引用的 Paper15
- BMC: Accelerating Memcached using Safe In-kernel Caching and Pre-stack ProcessingYoann Ghigoff, Julien Sopena, Kahina Lazri, Antoine Blin 等NSDI 2021 · 79 次引用
- Electrode: Accelerating Distributed Protocols with eBPFYang Zhou, Zezhou Wang, Sowmya Dharanipragada, Minlan YuNSDI 2023 · 78 次引用
- 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 次引用
- Verifying the Verifier: eBPF Range Analysis VerificationHarishankar Vishwanathan, Matan Shachnai, Srinivas Narayana, Santosh NagarakatteCAV 2023 · 37 次引用
- hXDP: Efficient Software Packet Processing on FPGA NICsMarco Spaziani Brunella, Giacomo Belocchi, Marco Bonola, Salvatore Pontarelli 等OSDI 2020 · 25 次引用
相关 Paper
- VEP: A Two-stage Verification Toolchain for Full eBPF ProgrammabilityXiwei Wu, Yueyang Feng, Tianyi Huang, Xiaoyang Lu 等NSDI 2025 · 8 次引用
- SoK: Challenges and Paths Toward Memory Safety for eBPFKaiming Huang, Mathias Payer, Zhiyun Qian, Jack Sampson 等S&P 2025
- Approximation Enforced Execution of Untrusted Linux Kernel ExtensionsHao Sun, Zhendong SuUSENIX Security 2025
- Prove It to the Kernel: Precise Extension Analysis via Proof-Guided Abstraction RefinementHao Sun, Zhendong SuSOSP 2025
- A Flow-Sensitive Refinement Type System for Verifying eBPF ProgramsAmeer Hamza, Lucas Zavalía, Arie Gurfinkel, Jorge A. Navas 等OOPSLA 2025 · 1 次引用
