Post #2171011
2024-09-13 12:19 UTC
Replies (2)
-
@gregkh@social.kernel.org 2024-09-14 06:38
In the same topic of "use frameworks to make bugs very hard to create", Alice Ryhl's patches for using a "range" api to access data from userspace: https://lore.kernel.org/r/20240913210031.20802-1-aliceryhl@google.com along with examples of how recent binder bugs were affected by this issue in C, and also were present in the Rust implementation, along with a proposal for how to prevent that are another good example of how the language can help us in kernel land by creating apis to help us do the right thing.
-
@hipsterelectron@circumstances.run 2024-09-14 08:20
@gregkh@social.kernel.org The API introduced in this series is not a silver bullet, users are still able to access the untrusted value (otherwise how would they be able to validate it?). But it provides additional guardrails to remind users that they ought to validate the value before using it. As already stated, they can access the value directly, but to do that, they need to explicitly call one of the untrusted_* functions signaling to reviewers that they are reading untrusted data without validation. this does not seem to indicate that anything is being checked at build time? is there a part of the patch that demonstrates the zero-overhead build-time checking you describe? or is your point that the rust for linux people are receptive to these concerns and other kernel devs aren't? i'm confused by "this change forces you to always be aware of that, which is something that C in the kernel does not" when the part i quoted very explicitly says it is not a silver bullet and just provides additional guardrails (which is obviously useful, i'm not contesting that)