Greg Kroah-Hartman: Rust Can Shield Linux from the Risks of AI-Generated Code
Greg Kroah-Hartman, a Linux kernel maintainer, considers Rust key to the system's security. The language helps avoid an entire class of vulnerabilities, particularly in the context of AI-generated code, which he sees as the main new threat to critical systems. He is clear that Rust is not magic. It is a pragmatic way to eliminate a whole category of bugs.
AI-processed from ZDNet AI; edited by Hamidun News
Greg Kroah-Hartman, the stable maintainer of the Linux kernel, considers Rust critically important for the operating system's future security. He stresses, however, that Rust is not magic but a pragmatic solution for eliminating an entire class of vulnerabilities.
Rust in the Linux kernel
Rust has been working its way into the Linux kernel source code for several years, and the integration is accelerating. Kroah-Hartman sees this as a strategic necessity, not a fad. Rust lets developers write systems code with much stronger safety guarantees than C, the language in which most of the kernel is written.
Protection against AI vulnerabilities
The new threat is code generated by neural networks. When ChatGPT or other LLMs write functions for Linux, they often contain classic bugs: buffer overflows, use-after-free, race conditions. Human review does not always catch them. Rust, by contrast, simply will not compile such code: the language forces the developer to rewrite dangerous constructs.
That does not mean AI code will be perfect. But a whole class of the most serious vulnerabilities, which in C code require painstaking code review, simply will not compile in Rust.
How it works
Rust achieves safety through several mechanisms:
- Ownership and borrowing: a system that guarantees memory is always managed safely
- No null pointers: Rust has no null pointers; an Option type is used instead
- Type system: strict typing catches logic errors at compile time
- Panic instead of undefined behavior: instead of silently corrupting memory, Rust panics and logs the error
All this means an entire class of vulnerabilities is simply impossible in Rust. Not because the language is magical, but because its design forces the developer to think about security from the start.
"Rust forces you to write correct code on the first try" is the principle in the community, and it is exactly what
Linux needs.
Scale of the integration
Kroah-Hartman is not talking about rewriting the entire kernel in Rust. That is unrealistic and unnecessary. Instead, the strategy is to gradually add new subsystems in Rust where it matters most: drivers, file systems, network stacks. The old C code will live alongside them, but the new components will benefit from the language.
What this means
Integrating Rust into Linux is not a philosophical choice but a practical response to new threats. AI-generated code will not go away; it will be increasingly embedded in development. Linux, as the foundation of the internet and of critical systems, must protect itself: not from all errors (that is impossible), but from the most dangerous ones. Rust, though not perfect, gives Linux a powerful tool for that protection.
- Nov 1, 2026Local models lose to Opus and Codex: 0.21 on a MacBook versus 1.00 for Codex
- Nov 1, 2026Kimi scores 96.2% on a 1C database analytics test and emerges as a fallback if Claude access is blocked
- Nov 1, 2026OpenAI Rewrites GPT Behavior Rules: Five Values and a Chain of Command
- Nov 1, 2026Google admits AI Mode cuts search revenue, shares fall 15%
Key Questions Answered
What are the key details on Rust in the Linux kernel?
Rust has been working its way into the Linux kernel source code for several years, and the integration is accelerating. Kroah-Hartman sees this as a strategic necessity, not a fad. Rust lets developers write systems code with much stronger safety guarantees than C, the language in which most of the kernel is written.
What are the key details on Protection against AI vulnerabilities?
The new threat is code generated by neural networks. When ChatGPT or other LLMs write functions for Linux, they often contain classic bugs: buffer overflows, use-after-free, race conditions. Human review does not always catch them. Rust, by contrast, simply will not compile such code: the language forces the developer to rewrite dangerous constructs. That does not mean AI code will be perfect. But a whole class of the most serious vulnerabilities, which in C code require painstaking code review, simply will not compile in Rust.
How it works?
Rust achieves safety through several mechanisms: Ownership and borrowing: a system that guarantees memory is always managed safely No null pointers: Rust has no null pointers; an Option type is used instead Type system: strict typing catches logic errors at compile time Panic instead of undefined behavior: instead of silently corrupting memory, Rust panics and logs the error All this means an entire class of vulnerabilities is simply impossible in Rust. Not because the language is magical, but because its design forces the developer to think about security from the start. "
Test Frontier LLMs & Autonomous Agents in One Workspace
Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.