nikomatsakis / context-capabilities-initiative

https://nikomatsakis.github.io/context-capabilities-initiative/
Apache License 2.0
12 stars 1 forks source link

Track blog posts #6

Open yoshuawuyts opened 2 years ago

yoshuawuyts commented 2 years ago

Blog posts have been written by members of the community, this is an issue gathering them so we can reference them later on:

gmorenz commented 1 year ago
yoshuawuyts commented 1 year ago

https://www.memorysafety.org/blog/gary-guo-klint-rust-tools/ talks about representing various contexts in the kernel. They briefly discuss contexts/capabilities as well:

People familiar with paradigms in Rust might also wonder if a token type, or some possible context and capabilities extension might help with this, but unfortunately it would not help this scenario. You can't do negative reasoning with token types thus a token-based approach would require almost all functions to carry tokens in their signatures.

In the end, we took none of the above approaches. There are no safeguards in the kernel's Rust API abstractions that prevent sleep-in-atomic-context from happening. This means that if you compile your kernel with preemption count tracking disabled, it's possible to write a Rust driver with only safe code that results in a use-after-free. Pragmatism is prioritised over soundness.