Rust support for the Linux kernel
Summary
Jonathan Corbet describes early proposals to introduce Rust in a controlled way as a second language for memory-safe drivers and kernel modules. The discussion took place at the Linux Plumbers Conference in 2020. Miguel Ojeda led the early Rust for Linux work.
Ideas
- Rust prevents many invalid memory accesses at compile time.
- Kernel code needs an environment without the normal standard library.
- Bindings connect Rust modules with existing C interfaces.
- Unsafe blocks concentrate unavoidable trust assumptions in visible places.
Insights
- A safe language reduces classes of bugs but does not eliminate logic errors.
- New languages bring toolchain and maintenance obligations for decades.
- Gradual introduction protects stability and creates practical learning experience.
Facts
- The Linux kernel previously consisted almost entirely of C and assembly.
Recommendations
- Start with new, clearly delimited drivers.
- Review unsafe Rust blocks with the same care as C code.
References
Links to the original source and the Web Archive open in a new tab.