-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Consider disabling LVI mitigations in the x86_64-fortanix-unknown-sgx target #108414
Copy link
Copy link
Open
Labels
A-securityArea: Security (example: address space layout randomization).Area: Security (example: address space layout randomization).A-target-featureArea: Enabling/disabling target features like AVX, Neon, etc.Area: Enabling/disabling target features like AVX, Neon, etc.A-target-specsArea: Compile-target specificationsArea: Compile-target specificationsO-SGXTarget: SGXTarget: SGXO-x86_64Target: x86-64 processors (like x86_64-*) (also known as amd64 and x64)Target: x86-64 processors (like x86_64-*) (also known as amd64 and x64)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-securityArea: Security (example: address space layout randomization).Area: Security (example: address space layout randomization).A-target-featureArea: Enabling/disabling target features like AVX, Neon, etc.Area: Enabling/disabling target features like AVX, Neon, etc.A-target-specsArea: Compile-target specificationsArea: Compile-target specificationsO-SGXTarget: SGXTarget: SGXO-x86_64Target: x86-64 processors (like x86_64-*) (also known as amd64 and x64)Target: x86-64 processors (like x86_64-*) (also known as amd64 and x64)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
The x86_64-fortanix-unknown-sgx target currently has Load Value Injection (LVI) mitigations enabled by default. These mitigations were introduced by #72655. At the time, these software mitigations were necessary on all Intel hardware to protect against the LVI vulnerability (CVE-2020-0551). Recent CPUs (such as Icelake and newer) now have hardware-level protections against LVI 1, which makes the software-based mitigations unnecessary.
Since LVI software mitigations can result in significant performance overheads (2x to 19x slowdown factor)2, it would be preferable to make these mitigations opt-in rather than enabled by default.
That being said the situation regarding speculative execution vulnerabilities is not simple. The LVI mitigations that we have enabled today might give us protection against other speculative attacks. So before removing the LVI mitigations, it's important to investigate whether we need software-based mitigations against other speculative execution attacks. For example, I saw that recent CPUs are vulnerable to Branch History Injection (BHI) and Intra-Mode BTI vulnerabilities3. Those vulnerabilities are of the Spectre variant 2 kind. Those are usually mitigated with retpolines on x86 platforms, so we should consider using
target-feature=+retpoline. Intel's technical documentation provides some recommendations4. It's worth noting that retpolines are much lighter than LVI mitigations, typically resulting only in a 5-10% overhead5.Thus, if we just need this mitigation on modern CPUs, this will already be a big performance win.
@jethrogb @raoulstrackx : what do you think ?
Footnotes
https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/resources/processors-affected-load-value-injection.html ↩
https://www.phoronix.com/review/lvi-attack-perf ↩
https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00598.html ↩
https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/technical-documentation/branch-history-injection.html ↩
https://www.phoronix.com/news/LLVM-Retpoline-Added ↩