← Lab /Security & privacy

Heimdall automatically migrates eBPF C programs to Rust with formal equivalence for 94% of cases

Heimdall can produce formally proven-equivalent Rust translations for 96 out of 102 eBPF programs

Security & privacy arXiv 25 May 2026 Method Prototype evidence

Published as “Heimdall: Formally Verified Automated Migration of Legacy eBPF Programs to Rust”

Why it matters

The system enables safe, memory-safe migration of production eBPF tools to Rust with formal guarantees, reducing information-leak bugs and improving source-level safety.

Summary

Heimdall automatically migrates legacy eBPF C programs to safe Aya Rust and formally proves that the translation preserves observable behavior. Across 102 real-world eBPF programs, it produces 96 formally verified equivalent translations (94.1%). The evidence comes from a full-scale evaluation using symbolic execution and Z3, showing orders-of-magnitude improvement over baseline LLM-only translation (2-6% triple-pass). However, six programs remain unverified due to solver limits or partial verification.

Caveats 7

  • Six programs are not fully verified: three only partially verified due to symbolic execution time or memory limits, and three exceed solver limits entirely.
  • Bytecode size of the Rust translations is on average 2.89× larger than the original C binaries.
  • Translations contain an average of 18.3 unsafe operations, indicating residual unsafe patterns.
  • The approach does not eliminate kernel-verifier bugs, as it still passes the same bytecode through the verifier.
  • three are partially verified (a subset of entry points proven equivalent, with the rest exceeding symbolic execution time or memory limits)
  • the other three (ksnoop, suricata_xdp_filter, suricata_xdp_lb) are unverified since all entry points exceed solver limits
  • Heimdall does not eliminate these kernel-side bugs since it compiles to the same bytecode and passes through the same verifier pipeline

What’s new here 4

  • Automated C-to-Rust translation pipeline that iteratively repairs compilation, kernel-verifier, and safety failures using LLM feedback.
  • Per-program formal equivalence checking at the eBPF bytecode level via a new angr symbolic-execution backend and Z3.
  • Static analysis engine that enforces safe-Aya policies, rejecting unsafe Rust patterns that bypass the verifier.
  • Comprehensive benchmark of 102 production eBPF programs with public release of translations and verification artifacts.