Lune

SIGCOMM2021顶会

Synthesizing safe and efficient kernel extensions for packet processing

Qiongwen Xu, Michael D. Wong, Tanvi Wagle, Srinivas Narayana, Anirudh Sivaraman

摘要

Extended Berkeley Packet Filter (BPF) has emerged as a powerful method to extend packet-processing functionality in the Linux operating system. BPF allows users to write code in high-level languages (like C or Rust) and execute them at specific hooks in the kernel, such as the network device driver. To ensure safe execution of a user-developed BPF program in kernel context, Linux uses an in-kernel static checker. The checker allows a program to execute only if it can prove that the program is crash-free, always accesses memory within safe bounds, and avoids leaking kernel data.

BPF programming is not easy. One, even modest-sized BPF programs are deemed too large to analyze and rejected by the kernel checker. Two, the kernel checker may incorrectly determine that a BPF program exhibits unsafe behaviors. Three, even small performance optimizations to BPF code (e.g., 5% gains) must be meticulously hand-crafted by expert developers. Traditional optimizing compilers for BPF are often inadequate since the kernel checker's safety constraints are incompatible with rule-based optimizations.

We present K2, a program-synthesis-based compiler that automatically optimizes BPF bytecode with formal correctness and safety guarantees. K2 produces code with 6-26% reduced size, 1.36%-55.03% lower average packet-processing latency, and 0-4.75% higher throughput (packets per second per core) relative to the best clang-compiled program, across benchmarks drawn from Cilium, Facebook, and the Linux kernel. K2 incorporates several domainspecific techniques to make synthesis practical by accelerating equivalence-checking of BPF programs by 6 orders of magnitude.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 13 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Formal Methods for Network Performance Analysis 引用了 Switch Code Generation Using Program Synthesis
  • Verified programs can party: optimizing kernel extensions via post-verification merging 引用了 Synthesizing JIT Compilers for In-Kernel DSLs
  • Verified programs can party: optimizing kernel extensions via post-verification merging 引用了 Specification and verification in the field: Applying formal methods to BPF just-in-time compilers in the Linux kernel
  • Verifying the Verifier: eBPF Range Analysis Verification 引用了 Synthesizing JIT Compilers for In-Kernel DSLs
  • Verifying the Verifier: eBPF Range Analysis Verification 引用了 Dataflow-based pruning for speeding up superoptimization
  • 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
  • Specification and verification in the field: Applying formal methods to BPF just-in-time compilers in the Linux kernel 引用了 Synthesizing JIT Compilers for In-Kernel DSLs
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper13

  1. Verifying the Verifier: eBPF Range Analysis VerificationHarishankar Vishwanathan, Matan Shachnai, Srinivas Narayana, Santosh NagarakatteCAV 2023 · 37 次引用
  2. Formal Methods for Network Performance AnalysisMina Tahmasbi Arashloo, Ryan Beckett, Rachit AgarwalNSDI 2023 · 27 次引用
  3. LiteFlow: towards high-performance adaptive neural networks for kernel datapathJunxue Zhang, Chaoliang Zeng, Hong Zhang, Shuihai Hu 等SIGCOMM 2022 · 23 次引用
  4. Verified programs can party: optimizing kernel extensions via post-verification mergingHsuan-Chi Kuo, Kai-Hsun Chen, Yicheng Lu, Dan Williams 等EuroSys 2022 · 17 次引用
  5. Meissa: scalable network testing for programmable data planesNaiqian Zheng, Mengqi Liu, Ennan Zhai, Hongqiang Harry Liu 等SIGCOMM 2022 · 17 次引用

它引用的 Paper5

  1. 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 次引用
  2. Switch Code Generation Using Program SynthesisXiangyu Gao, Taegyun Kim, Michael D. Wong, Divya Raghunathan 等SIGCOMM 2020 · 51 次引用
  3. Reconciling enumerative and deductive program synthesisKangjing Huang, Xiaokang Qiu, Peiyuan Shen, Yanjun WangPLDI 2020 · 46 次引用
  4. Synthesizing JIT Compilers for In-Kernel DSLsJacob Van Geffen, Luke Nelson, Isil Dillig, Xi Wang 等CAV 2020 · 27 次引用
  5. Dataflow-based pruning for speeding up superoptimizationManasij Mukherjee, Pranav Kant, Zhengyang Liu, John RegehrOOPSLA 2020 · 21 次引用

相关 Paper

  1. EPSO: A Caching-Based Efficient Superoptimizer for BPF BytecodeQian Zhu, Yuxuan Liu, Ziyuan Zhu, Shangqing Liu 等ASE 2025
  2. Merlin: Multi-tier Optimization of eBPF Code for Performance and CompactnessJinsong Mao, Hailun Ding, Juan Zhai, Shiqing MaASPLOS 2024 · 15 次引用
  3. VEP: A Two-stage Verification Toolchain for Full eBPF ProgrammabilityXiwei Wu, Yueyang Feng, Tianyi Huang, Xiaoyang Lu 等NSDI 2025 · 8 次引用
  4. LDBF: Deep Exploration of eBPF Runtime via LLM-Driven Program Generation and Adaptive Context OrchestrationYinhao Hu, Kaiyan Mei, Zeyu Sun, Quan Sun 等CCS 2026
  5. Rex: Closing the language-verifier gap with safe and usable kernel extensionsJinghao Jia, Ruowen Qin, Milo Craun, Egor Lukiyanov 等USENIX ATC 2025 · 11 次引用
黄昏的海面,两侧是细线勾勒的悬崖