]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Auto merge of #95548 - rcvalle:rust-cfi-2, r=nagisa
authorbors <bors@rust-lang.org>
Sun, 24 Jul 2022 01:22:36 +0000 (01:22 +0000)
committerbors <bors@rust-lang.org>
Sun, 24 Jul 2022 01:22:36 +0000 (01:22 +0000)
commitdb8086eb6056f022d3bb719f777307e9daa3f8d8
tree34b77df8f88f3024355caf7fc954e1bcccb7f2a5
parentfcad91868a515c51d0762bf6c7af2bedc11cc348
parentf792f26a384cb036199ad30a57a2be22a9feef47
Auto merge of #95548 - rcvalle:rust-cfi-2, r=nagisa

Add fine-grained LLVM CFI support to the Rust compiler

This PR improves the LLVM Control Flow Integrity (CFI) support in the Rust compiler by providing forward-edge control flow protection for Rust-compiled code only by aggregating function pointers in groups identified by their return and parameter types.

Forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space) will be provided in later work as part of this project by identifying C char and integer type uses at the time types are encoded (see Type metadata in the design document in the tracking issue https://github.com/rust-lang/rust/issues/89653).

LLVM CFI can be enabled with -Zsanitizer=cfi and requires LTO (i.e., -Clto).

Thank you again, `@eddyb,` `@nagisa,` `@pcc,` and `@tmiasko` for all the help!
Cargo.lock
compiler/rustc_codegen_gcc/src/builder.rs
compiler/rustc_codegen_ssa/src/mir/block.rs
compiler/rustc_codegen_ssa/src/traits/builder.rs
compiler/rustc_symbol_mangling/src/v0.rs
src/doc/unstable-book/src/compiler-flags/sanitizer.md
src/tools/compiletest/src/header.rs
src/tools/compiletest/src/util.rs