The Linux kernel is a moving target. With thousands of commits per release, internal APIs and data structures shift constantly. For driver maintainers, this creates a "mismatch zone" where a working driver suddenly breaks because the kernel core evolved beneath it. Traditionally, fixing this is a manual, grueling process of trial-and-error debugging.
A new paper from researchers at MBZUAI introduces DRIVEBENCH and AUTODRIVER, a duo designed to move kernel maintenance from manual labor to automated, LLM-driven co-evolution.
The Problem: The Maintenance Burden of Co-evolution
Linux does not maintain a stable internal API/ABI. When a kernel developer refactors a core function—perhaps for security hardening or performance—every driver using that function must be updated. This "co-evolution" is a massive maintenance burden, especially for out-of-tree drivers or vendors supporting long-lived products.
Naive LLM approaches (just asking a model to "fix this code") fail in the kernel domain due to several fundamental system properties.
As shown above, failures often stem from three main areas:
- Non-local semantics: Changes in one file often depend on implicit assumptions in another.
- Weak oracles: Code that looks correct (syntactically) might fail at boot time or introduce silent security regressions.
- Noisy supervision: Historical commit data is often messy, mixing stylistic cleanups with critical functional fixes.
The Solution: DRIVEBENCH and AUTODRIVER
The researchers developed AUTODRIVER, a multi-agent LLM system that automatically patches Linux drivers to match kernel updates, and DRIVEBENCH, a first-of-its-kind executable dataset of real-world driver breakages.
Methods
AUTODRIVER consists of four specialized agents: Prompt Engineering, Coding, Patch Fix, and Static Analysis. Key technical innovations include:
- Taxonomy-Aware Prompting: System templates tailored to specific types of changes (e.g., API migrations vs. security hardening).
- Localization via Linux LSP: Using a specialized Language Server Protocol (LSP) to extract only the relevant code windows centered around affected functions, reducing token noise.
- Iterative Error Correction: If a patch fails to compile, the system captures compiler diagnostics and feeds them back to the Coding Agent for a "self-healing" retry. Most successful patches converge within 3 to 5 iterations.
- Multi-Stage Validation: Patches undergo static analysis (AST-based scoring) followed by dynamic validation in a QEMU-emulated Linux environment to verify correct initialization.
Datasets
DRIVEBENCH provides an executable corpus of 235 validated cases spanning Linux versions v5.10 to v6.10. Each "case pack" includes source trees, triggering kernel patches, build scripts, and metadata labeled under a hierarchical taxonomy.
Key Insights and Results
The researchers found that simple text-based diffs are poor metrics for patch quality. Instead, they used Tree-sitter to generate Abstract Syntax Trees (ASTs) and compared the structure of the LLM’s patch to the ground truth. This revealed that models like DeepSeek are significantly better at adhering to "kernel coding idioms" than general-purpose models.
Key Performance Metrics: * Compilation Success: AUTODRIVER achieved a 56.4% compilation success rate. * Model Comparison: DeepSeek outperformed ChatGPT, achieving a composite static score of 0.751 vs. ChatGPT’s 0.697. * High-Fidelity Patches: DeepSeek produced "perfect-score" patches (structurally identical to human-written ones) 17.5% of the time.
Limitations and Future Work
While the system marks a significant step forward, it currently struggles with updates requiring coordinated changes across multiple directories or architecture-specific headers. Furthermore, hardware-bound drivers remain difficult to validate without physical devices or high-fidelity digital twins. Future work aims to integrate symbolic execution tools like KLEE to catch deeper logic bugs and scale DRIVEBENCH as a continuous benchmark for code intelligence.
By providing both the dataset and the multi-agent framework, this work offers a practical roadmap for a future where the Linux kernel can evolve without leaving its driver ecosystem behind.
Summary updated