3 ms·
ASLR is only relevant if you're exploiting a memory-safety bug. It is therefore "useless" in a safe Rust program (just as it's "useless" in Python, Java, JS, et
by Gankro 10y ago
ASLR is only relevant if you're exploiting a memory-safety bug. It is therefore "useless" in a safe Rust program (just as it's "useless" in Python, Java, JS, etc), but this is assuming:
* all the underlying unsafe routines are correctly implemented (unlikely in theory, false in practice)
* the compiler is correctly implemented (objectively false)
* the OS doesn't have a weird bug/hole that pwns safe programs (not very informed here, would be interested to hear examples of this)
* C libraries the Rust code FFI's into are correct (libc, openssl, gtk, etc...)
All safe languages gain defense-in-depth benefits from ASLR (insofar as anything benefits from ASLR), because our whole software stack is riddled with bugs.