Heimdall: Formally Verified Automated Migration of Legacy eBPF Programs to Rust

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Dasu, Vishnu Asutosh, Santra, Monika, Rashid, Md Rafi Ur, Kumar, Ashish, Tizpaz-Niari, Saeid, Tan, Gang
Format: Preprint
Published: 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866913161211281408
author Dasu, Vishnu Asutosh
Santra, Monika
Rashid, Md Rafi Ur
Kumar, Ashish
Tizpaz-Niari, Saeid
Tan, Gang
author_facet Dasu, Vishnu Asutosh
Santra, Monika
Rashid, Md Rafi Ur
Kumar, Ashish
Tizpaz-Niari, Saeid
Tan, Gang
contents Extended Berkeley Packet Filter (eBPF) programs are kernel extensions used for networking, observability, and security enforcement in the Linux kernel. The in-kernel eBPF verifier checks low-level memory safety and termination on eBPF programs, but it does not enforce many higher-level source-level properties, such as initialization discipline, schema consistency, or error handling. We document six classes of source-level bugs that compile, pass the kernel verifier, and can silently corrupt data, leak previously traced events to userspace, or yield incorrect enforcement outcomes. Among these, we identify previously unreported information leaks in ten open-source eBPF programs whose ring-buffer or stack-resident event records carry fully decodable prior traced events, including user-identifying paths and recurring kernel-text return addresses sufficient to recover the KASLR slide on every event, into userspace. To harden such verifier-accepted buggy programs and support safe migration, we present Heimdall, an automated pipeline that uses large language models to translate legacy libbpf C programs to Aya Rust. Heimdall iteratively repairs compilation and kernel-verifier failures, rejects unsafe escape hatches in Rust-Aya with a static analysis safety engine, and proves per-program equivalence to the original via symbolic execution and Z3-based equivalence checking. Across 102 eBPF programs, Heimdall produces 96 formally proven-equivalent translations (94.1%). Heimdall is the first system to automate memory-safe-language migration of production eBPF programs with per-program formal guarantees that the migration preserves observable behavior.
format Preprint
id arxiv_https___arxiv_org_abs_2605_25411
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Heimdall: Formally Verified Automated Migration of Legacy eBPF Programs to Rust
Dasu, Vishnu Asutosh
Santra, Monika
Rashid, Md Rafi Ur
Kumar, Ashish
Tizpaz-Niari, Saeid
Tan, Gang
Cryptography and Security
Symbolic Computation
Extended Berkeley Packet Filter (eBPF) programs are kernel extensions used for networking, observability, and security enforcement in the Linux kernel. The in-kernel eBPF verifier checks low-level memory safety and termination on eBPF programs, but it does not enforce many higher-level source-level properties, such as initialization discipline, schema consistency, or error handling. We document six classes of source-level bugs that compile, pass the kernel verifier, and can silently corrupt data, leak previously traced events to userspace, or yield incorrect enforcement outcomes. Among these, we identify previously unreported information leaks in ten open-source eBPF programs whose ring-buffer or stack-resident event records carry fully decodable prior traced events, including user-identifying paths and recurring kernel-text return addresses sufficient to recover the KASLR slide on every event, into userspace. To harden such verifier-accepted buggy programs and support safe migration, we present Heimdall, an automated pipeline that uses large language models to translate legacy libbpf C programs to Aya Rust. Heimdall iteratively repairs compilation and kernel-verifier failures, rejects unsafe escape hatches in Rust-Aya with a static analysis safety engine, and proves per-program equivalence to the original via symbolic execution and Z3-based equivalence checking. Across 102 eBPF programs, Heimdall produces 96 formally proven-equivalent translations (94.1%). Heimdall is the first system to automate memory-safe-language migration of production eBPF programs with per-program formal guarantees that the migration preserves observable behavior.
title Heimdall: Formally Verified Automated Migration of Legacy eBPF Programs to Rust
topic Cryptography and Security
Symbolic Computation
url https://arxiv.org/abs/2605.25411