The question was rhetorical; I was trying to get the guy above to answer it because he seems to think that Rust is somehow inherently more insecure than C (or alternatively, that adding Rust to the kernel would increase its attack surface compared to C), when in reality as you have correctly said, it's the other way around.
Thank you for the rundown though, I'm sure the comment will be useful to readers unfamiliar with the principles at play.
While that is correct it's more about SLOC and not about the size of the text section. You're likely going to write less SLOC in Rust than in C and consequently have less opportunities to introduce bugs in your code. Not too mention that the Rust Compiler also does a fine job at preventing a lot of typical C errors.
Immediately yes, but it's an investment into the safety of future development. Every single driver written into the kernel is an increase in the attack surface. If Rust reduces each of them by 50% (just pulling numbers out of ass, some studies argue up to 80% of vulnerabilities are root-caused by memory issues that are preventable with Rust) then in a few short years of new hardware support it will have been a good decision. Also, the base infrastructure, being comprised of common artifacts used for future development ostensibly by many organizations, will have many more eyes on it and much more rigorous testing than any individual driver modules written in C.
Rejecting the language based on the need to pull in some initial tooling to support it is shortsighted, IMO.
41
u/WindowsHate Apr 15 '21
The question was rhetorical; I was trying to get the guy above to answer it because he seems to think that Rust is somehow inherently more insecure than C (or alternatively, that adding Rust to the kernel would increase its attack surface compared to C), when in reality as you have correctly said, it's the other way around.
Thank you for the rundown though, I'm sure the comment will be useful to readers unfamiliar with the principles at play.