News for hackers. Stuff that matters.
Re:Let rand = main as usize by _flux on Thursday June 06, 2024 @04:23PM (#40601942)
Unsafe code can rarely validate pointers it receives and must depend on the properties of the other code to work safely. It just doesn't depend on the safety properties of that other code.
Re:Let rand = main as usize by haileys on Thursday June 06, 2024 @04:27PM (#40601981)
Exactly. So you must use Rust's encapsulation features like modules and visibility to ensure that any particular piece of unsafe code _cannot_ receive a pointer that can't be proven to be valid.