-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for LLVM ShadowCallStack. #98208
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
|
This comment has been minimized.
This comment has been minimized.
I'm not an expert in codegen so passing this to another compiler person r? rust-lang/compiler |
cc @rust-lang/wg-llvm |
Friendly ping for review? Thanks! |
r? @nagisa I don't really know enough about this to make a real decision. |
Friendly ping for review, thanks! |
Not familiar with this sanitizer, but the implementation looks fine to me. Only suggestion I'd make is to also add a |
FWIW I only really have time for reviews on the weekends, and summer is also a vacation season, so it might be some time before I can get to reviewing a PR. |
☔ The latest upstream changes (presumably #99422) made this pull request unmergeable. Please resolve the merge conflicts. |
Adds support for the LLVM ShadowCallStack sanitizer.
Thanks for the review! I believe I've addressed all the comments. And also thanks for the heads up on when you're able to handle reviews -- totally understand and appreciate the value of recharging. |
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (93ffde6): comparison url. Instruction count
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 |
LLVMs ShadowCallStack provides backward edge control flow integrity protection by using a separate shadow stack to store and retrieve a function's return address.
LLVM currently only supports this for AArch64 targets. The x18 register is used to hold the pointer to the shadow stack, and therefore this only works on ABIs which reserve x18. Further details are available in the LLVM ShadowCallStack docs.
Usage
-Zsanitizer=shadow-call-stack
Comments/Caveats