News for hackers. Stuff that matters.
Re:Unsoundness in Pin by zozbot234 on Friday November 29, 2019 @11:20AM (#21665199)
The line between "unintentional" bugs and "intentional/malicious" escape hatches is quite fuzzy given the extent that most Rust projects rely on outside code. Soundness bugs, at least in stable rust, are serious and should be addressed as such, or Rust developers will end up with a leftpad situation as soon as a popular third-party crate 'unintentionally' introduces some sort of soundness concern.
Re:Unsoundness in Pin by devit on Friday November 29, 2019 @11:33AM (#21665267)
Third party crates can include malicious safe code that doesn't exploit any soundness bugs, so I'm not sure how exploiting soundness bugs could make the situation worse.

It's only a problem if you try to restrict I/O APIs and use the Rust type system as a security boundary, which is something that I don't think anyone does and that should not be done since the surface area is too vast to secure without formal proofs of the whole Rust stack, which are too time-consuming to produce with current technologies.

Re:Unsoundness in Pin by __s on Friday November 29, 2019 @12:02PM (#21665443)
https://www.tockos.org does what you think nobody does
Re:Unsoundness in Pin by dethinking on Friday November 29, 2019 @12:18PM (#21665558)
TIL, and since it’s buried a bit:

> A capsule is a Rust struct and associated functions. Capsules interact with each other directly, accessing exposed fields and calling functions in other capsules. Trusted platform configuration code initializes them, giving them access to any other capsules or kernel resources they need. Capsules can protect internal state by not exporting certain functions or fields.

> ...

> Rust’s language protection offers strong safety guarantees. Unless a capsule is able to subvert the Rust type system, it can only access resources explicitly granted to it, and only in ways permitted by the interfaces those resources expose. However, because capsules are cooperatively scheduled in the same single-threaded event loop as the kernel, they must be trusted for system liveness. If a capsule panics, or does not yield back to the event handler, the system can only recover by restarting.

I take it from the present discussion that that might not be as good of an idea as they think.

Worth noting that they also have process isolation on top, but it doesn’t seem to be motivated by any potential insecurity of the type system.

Re:Unsoundness in Pin by staticassertion on Friday November 29, 2019 @08:57PM (#21668022)
I don't get how that's ever possible, regardless of soundness issues. Can you not simply use unsafe in a capsule, and violate this constraint? The only way isolates in V8 manage to provide any isolation is because the runtime/ language forbid such things entirely.

I suspect it is not so simple as "Rust's safety ensures malicious rust code can't access data".

Re:Unsoundness in Pin by __s on Friday November 29, 2019 @09:25PM (#21668127)
Capsules aren't allowed to use unsafe. The target of tock is not generally going to be out of order, so spectre things shouldn't occur
Re:Unsoundness in Pin by staticassertion on Friday November 29, 2019 @10:14PM (#21668291)
Is there a doc about that? Can they also not use external crates? Very curious.
Re:Unsoundness in Pin by __s on Saturday November 30, 2019 @12:58PM (#21671219)
Re:Unsoundness in Pin by staticassertion on Saturday November 30, 2019 @04:42PM (#21672294)
Thank you.
Re:Unsoundness in Pin by TheCoelacanth on Friday November 29, 2019 @02:38PM (#21666326)
Stealing credit card numbers, displaying adware and launching missiles are all safe Rust.

Rust does not offer any protection against malicious code and it does not claim to. It offers protection against malicious input to non-malicious code, but no protection against malicious code itself.