Closed
Description
This is tremendously open-ended, but at minimum we should implement the usual tricks from C compilers, such as
- Full ASLR
- Stack canaries
- Struct layout randomization — @huonw already wrote a plugin for this
- Read-only pages with dynamic relocations, and eager PLT resolution
- ASan support (Investigate running tests under Address Sanitizer #749)
This will protect unsafe
code, and will mitigate the impact of compiler bugs. Some of it will also protect buggy C code when it's linked with Rust.
The goal here isn't just to make these things possible but to have really painless toolchain support. In many cases the performance impact is insignificant and there's no reason not to compile with mitigations.
Beyond the established techniques, there are a lot of interesting research ideas we could implement. See for example Prof. Michael Franz's talk at Mozilla on compiler-generated software diversity.