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: Rust Can Shield Linux from the Risks of AI-Generated Code
Source: ZDNet AI. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceZDNet AI ↗
Editor-in-Chief
Ownership and borrowinga system that guarantees memory is always managed safely
No null pointersRust has no null pointers; an Option type is used instead
Type systemstrict typing catches logic errors at compile time

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.

Story

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. "

ZK
Zhemal Khamidun — CPO at Alpina Digital, product manager of AlpinaGPT. Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Unified AI Workspace · Nomad

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.

Try Nomad AI →Launch Nomad Agent
What do you think?
Loading comments…