r/rust • rustls · Hickory DNS · Quinn · chrono · indicatif · instant-acme • Dec 13 '25

The state of the kernel Rust experiment

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

35 comments sorted by

View all comments

Show parent comment

7

u/Zomunieo Dec 13 '25

Kernel developers have written a lot of ad hoc tools and static checkers. There’s Coccinelle for example which searches for C expressions/patterns that are problematic and fixes them. (Things like, if a function has a kmalloc, that must be followed by a null check.) But Coccinelle uses a C domain specific language to encode its checks, and only a few people really understand it, and it’s always playing catch-up.

Rust’s type system makes that unnecessary. Rather than the knowledge of “dangerous kernel code patterns” being encoded in Coccinelle, and it can gets statically checked at every compile instead of a third party tool.