4 ms·
What was the point of this post? No, this program isn't a replacement for sudo; it's closer to a reimplementation of su. The post links to 3 CVEs and talks abou
by CGamesPlay 4y ago
What was the point of this post? No, this program isn't a replacement for sudo; it's closer to a reimplementation of su. The post links to 3 CVEs and talks about Rust, but only one of the CVEs was a memory safety bug, the others are a logic error and a race condition, neither of which are protected by Rust (sadly).
- skcusgnad 4y ago[dead]
- bobbylarrybobby 4y agoI thought safe rust did prevent race conditions by preventing simultaneous write access to data except behind a Mutex or similar guard.
- CGamesPlay 4y agoThat's a memory safety issue that caused by a race condition. Rust prevents memory safety issues, but not race conditions. The race condition in one of the CVEs is in the filesystem, not in sudo.
- bobbylarrybobby 4y agoAh, thanks
- eptcyka 4y agoRust does prevent memory race conditions, but of course, only within the address space of the process and only for memory read and written to exclusively by rust code.
- progval 4y agoFor example, there is this (pure safe Rust) code: https://github.com/ben0x539/totally-safe-transmute/blob/main/src/lib.rs https://github.com/ben0x539/totally-safe-transmute/blob/main... which accesses external resources (/proc/self/mem) in order to violate the safety guarantees.
- imron 4y agoRust prevents data races which are only one kind of race condition.
- bogeholm 4y agoCheck out eg. “Race condition vs. Data Race: the differences explained” [0] [0]: https://www.avanderlee.com/swift/race-condition-vs-data-race/ https://www.avanderlee.com/swift/race-condition-vs-data-race...
- camel-cdr 4y agoBtw, there is a logical bug in the code, although it isn't exploitable. env::args().size() can be zero.
- distantsounds 4y ago[flagged]
- mikl 4y agoYeah, no idea why people are upvoting this. Reads like a listening to the internal jokes of a tight-knit group that you don’t know.