Rex: Safe and Usable Kernel Extensions in Rust
summary
Rex is a Linux kernel-extension framework that lets extensions be written in safe Rust only and eliminates the in-kernel verifier by emitting native code from a trusted Rust compiler plus a small kernel runtime. The compiler restricts code to a no-ref subset and enforces RAII wrappers for kernel resources; the runtime provides graceful panic handling with resource cleanup, per-CPU recorded helpers, runtime stack checks and a high-resolution timeout for safe termination. Supports kprobes/tracepoints/XDP/TC, reuses BPF maps, cuts LOC (300 vs 500) and matches or slightly outperforms eBPF.
AI-written summary · about
chapters (11)
- 0:00Rex framework intro
- 1:04BPF safety limits
- 6:01Rust verifier gap
- 7:47Compile-time safety in Rex
- 14:35Runtime safety in Rex
- 18:50Stack protection in Rex
- 21:43Rex implementation
- 23:50Rex usability and performance
- 27:00Conclusion and open source
- 27:42Live demo: error injection
- 33:38Q&A on trust and verifiers
related talks
30mRex and its integration with Rust-for-Linux
46mTracing the Linux kernel with eBPF and Rust
36mRust in the Kernel (via eBPF)
40mREX - RIK a container orchestrator in Rust
22mWhen to Use Native Extensions in Rust: Accessible, Safe Performance
28mInterfacing Rust with Xen
24mRust for Linux: Status Update
29m"10 Years of Redox OS and Rust"
