Add fine-grained LLVM CFI support to the Rust compiler#95548
Add fine-grained LLVM CFI support to the Rust compiler#95548bors merged 2 commits intorust-lang:masterfrom
Conversation
|
Some changes occured to rustc_codegen_gcc cc @antoyo |
|
r? @davidtwco (rust-highfive has picked a reviewer for you, use r? to override) |
|
r? @nagisa |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
compiler/rustc_symbol_mangling/src/typeid/typeid_itanium_cxx_abi.rs
Outdated
Show resolved
Hide resolved
compiler/rustc_symbol_mangling/src/typeid/typeid_itanium_cxx_abi.rs
Outdated
Show resolved
Hide resolved
compiler/rustc_symbol_mangling/src/typeid/typeid_itanium_cxx_abi.rs
Outdated
Show resolved
Hide resolved
compiler/rustc_symbol_mangling/src/typeid/typeid_itanium_cxx_abi.rs
Outdated
Show resolved
Hide resolved
compiler/rustc_symbol_mangling/src/typeid/typeid_itanium_cxx_abi.rs
Outdated
Show resolved
Hide resolved
|
@bors try |
|
⌛ Trying commit 26e0e2fa35ec940179f6a6958695f5c983d9838f with merge f3b1bd9b4aaafaa85ca8ac59698ca6ac1b6c839d... |
|
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
|
☔ The latest upstream changes (presumably #98206) made this pull request unmergeable. Please resolve the merge conflicts. |
|
@bors try |
|
⌛ Trying commit 7845e5af761b3bea8366f1f88ba10bc8e906cab0 with merge a607188a97cc5cd4d066808cbba3681a504ec3f0... |
|
☀️ Try build successful - checks-actions |
|
@bors r+ |
|
📌 Commit 7845e5af761b3bea8366f1f88ba10bc8e906cab0 has been approved by |
|
⌛ Testing commit 7845e5af761b3bea8366f1f88ba10bc8e906cab0 with merge b7043630dfadc284e196852738595393d6c541e7... |
|
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
|
@bors rollup=iffy |
|
⌛ Testing commit 7845e5af761b3bea8366f1f88ba10bc8e906cab0 with merge 63a9c9d05059ba6cdb67b75bee1429c7166bb9fd... |
This comment has been minimized.
This comment has been minimized.
|
💔 Test failed - checks-actions |
|
@bors r+ rollup=never |
|
📌 Commit c8d90e270275f980ea42e76ccc3a52fe67d31cc4 has been approved by It is now in the queue for this repository. |
|
⌛ Testing commit c8d90e270275f980ea42e76ccc3a52fe67d31cc4 with merge 5c514af3814b732c3702d4f9069e3bf8ae71aa85... |
This comment has been minimized.
This comment has been minimized.
|
💔 Test failed - checks-actions |
This commit 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 rust-lang#89653). LLVM CFI can be enabled with -Zsanitizer=cfi and requires LTO (i.e., -Clto).
This commit updates the documentation for the LLVM Control Flow Integrity (CFI) support in the Rust compiler (see rust-lang#95548 and rust-lang#89653).
|
@bors r+ |
|
☀️ Test successful - checks-actions |
|
Finished benchmarking commit (db8086e): comparison url. Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
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 #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!