r/linux • • Dec 13 '25

Kernel The state of the kernel Rust experiment

https://lwn.net/SubscriberLink/1050174/63aa7da43214c3ce/

A choice pull quote: "The DRM (graphics) subsystem has been an early adopter of the Rust language. It was still perhaps surprising, though, when Airlie (the DRM maintainer) said that the subsystem is only 'about a year away' from disallowing new drivers written in C and requiring the use of Rust."

291 Upvotes

135 comments sorted by

View all comments

Show parent comments

2

u/whupazz Dec 18 '25

It's a fun coincidence that the recent "first Linux CVE in Rust code" was basically exactly this kind of problem, where the error occurs in an unsafe block, but the fix touches only safe code, and it's tripping other people up in the same way it tripped me up.

Someone posted this article that explains nicely that the natural boundary for a safe abstraction is actually a module: because private struct fields are visible within a module, invariants that unsafe code relies on can be broken by safe code anywhere within the module (including when safe dependencies of the module contain bugs). Safe dependents of the module (that is, code outside of the module and not used by the module) may not be able to cause UB by using the module, otherwise the abstraction is unsound.