-
Notifications
You must be signed in to change notification settings - Fork 211
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
Manually patch ret instruction for LVI #359
Conversation
0323704
to
b0c9cd8
Compare
To avoid on the |
I may have misunderstood, are you suggesting to duplicate the whole 50-line function? That seems like unnecessary duplication to me and it would also introduce the risk that only one of the two functions would get updated when needed. |
Yes, that is what I'm suggesting. I'm not sure this function has changed since it was added, and it's easy enough that if a substantial change happens it's mirrored elsewhere. This crate already suffers from lots of |
b0c9cd8
to
f8ec557
Compare
Updated as requested |
@@ -163,6 +168,69 @@ global_asm!(define_rust_probestack!( | |||
" | |||
)); | |||
|
|||
// This function is the same as above, except that some instructions are |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually it may be reasonable for SGX to have its own implementation in the future because it likely knows a priori how big the stack is. We'll leave that for a future change though.
…enkov Enable LVI hardening for x86_64-fortanix-unknown-sgx This implements mitigations for the Load Value Injection vulnerability (CVE-2020-0551) for the `x86_64-fortanix-unknown-sgx` target by enabling new LLVM passes. More information about LVI and mitigations may be found at https://software.intel.com/security-software-guidance/insights/deep-dive-load-value-injection. This PR unconditionally enables the mitigations for `x86_64-fortanix-unknown-sgx` since there is no available hardware that doesn't require the mitigations. This may be reconsidered in the future. * [x] This depends on rust-lang/compiler-builtins#359
In order to land rust-lang/rust#72655 this change needs to be applied.
More info on the change: https://software.intel.com/security-software-guidance/insights/deep-dive-load-value-injection#specialinstructions