4 ms·
I thought safe rust did prevent race conditions by preventing simultaneous write access to data except behind a Mutex or similar guard.
by bobbylarrybobby 4y ago
I 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...