Discover Rex, a groundbreaking safe kernel extension framework that lets developers write and execute Rust programs directly in the kernel, replacing eBPF limitations. Unlike traditional eBPF frameworks like Aya, Rex skips the restrictive in-kernel verifier by leveraging Rust’s safe subset. The Rust compiler handles safety checks and generates native code via LLVM, eliminating verifier complexity constraints, arcane errors, and suboptimal JIT compilation.
Key features include support for kprobe, perf_event, tracepoint, XDP, and TC program types; eBPF helper functions and map interactions; RAII resource management; panic handling with stack traces; kernel stack safety; and kernel data type bindings. Rex offers cleaner, more expressive code without eBPF’s burdens.
Example: A kprobe program injecting errors into syscalls for specific PIDs using RexHashMap. Samples like error_injector and BMC (Memcached cache acceleration) showcase Rust idioms like iterators replacing verbose eBPF loops.
Build instructions and docs are in the repo. Why Rex? It fixes eBPF usability issues with safe Rust freedom. Licensed GPLv2.
https://github.com/rex-rs/rex