Abstract
AbstractModern operating systems have adopted Berkeley Packet Filters (BPF) as a mechanism to extend kernel functionalities dynamically, e.g., Linux’s eBPF or RIOT’s rBPF. The just-in-time (JIT) compilation of eBPF introduced in Linux eBPF for performance has however led to numerous critical issues. Instead, RIOT’s rBPF uses a slower but memory-isolating interpreter (a virtual machine) which implements a defensive semantics of BPF; and therefore trades performance for security. To increase performance without sacrificing security, this paper presents a fully verified JIT implementation for RIOT’s rBPF, consisting of: i/ an end-to-end refinement workflow to both proving the JIT correct from an abstract specification and by deriving a verified concrete C implementation; ii/ a symbolic CompCert interpreter for executing binary code; iii/ a verified JIT compiler for rBPF; iv/ a verified hybrid rBPF virtual machine. Our core contribution is, to the best of our knowledge, the first and fully verified rBPF JIT compiler with correctness guarantees from high-level specification to low-level implementation. Benchmarks on microcontrollers hosting the RIOT operating system demonstrate significant performance improvements over the existing implementations of rBPF, even in worst-case application scenarios.
Publisher
Springer Nature Switzerland
Reference40 articles.
1. Anand, A., et al.: CertiCoq : a verified compiler for Coq. In: CoqPL (2017)
2. Baccelli, E., et al.: RIOT: an open source operating system for low-end embedded devices in the IoT. IoT-J 5(6), 4428–4440 (2018)
3. Barrière, A., Blazy, S., Flückiger, O., Pichardie, D., Vitek, J.: Formally verified speculation and deoptimization in a JIT compiler. Proc. ACM Program. Lang. 5(POPL), 26 (2021). https://doi.org/10.1145/3434327
4. Barrière, A., Blazy, S., Pichardie, D.: Formally verified native code generation in an effectful JIT: Turning the CompCert backend into a formally verified JIT compiler. Proc. ACM Program. Lang. 7(POPL), 249–277 (2023). https://doi.org/10.1145/3571202
5. Bertot, Y., Castéran, P.: Interactive theorem proving and program development: Coq’Art: the calculus of inductive constructions. Springer (2013)