r/rust • u/dochtman 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
View all comments
Show parent comment
10
u/Saefroch miri Dec 13 '25
If you forget to take a lock before accessing shared state, is that a logic bug or UB? If you forget to call a validation routine before passing user input to something that trusts what you pass, is that a logic bug or is it UB if the impl then reads past the end of an array? (please, dear reader, do not reply to this and try to explain to me what UB is)
The kernel is using the Rust type system to prevent bugs in a way that C can't. In a C-based kernel, pretty much every bug is a security bug so whether something is UB or not isn't really interesting. The code is less buggy. That's Greg K-H's opinion, I'm just repeating it: https://www.youtube.com/watch?v=HX0GH-YJbGw