The Brutal Performance Impact From Mitigating The LVI Vulnerability

Written by Michael Larabel in Software on 12 March 2020. Page 6 of 6. 76 Comments

OpenSSL signing performance dropped to nearly a tenth of its original performance when making use of LFENCEs after loads.

Google's LevelDB was significantly impacted with operations taking nearly twice as long.

PostgreSQL performance was also hit significantly.

The results of these benchmarks are quite staggering but, fortunately, most users probably don't need to rebuild all of their software packages with these assembler-based mitigations. It may make sense for any security-sensitive applications and those running public services / potentially untrusted code and particularly those interacting with Intel SGX but there are differing views currently over the real-world prospects of an LVI attack vector. At least that would be the guidance for now. What's worrisome is that if there are any more broad transient execution flaws based on LVI to be discovered (or to be publicly disclosed) that could end up necessitating this increased LFENCE usage to become more widespread considering how we have seen these microarchitectural vulnerabilities build up over time. But at least for now only the most concerned security concious end-users should be using these mitigation options or enterprises where Intel SGX is more widely used and public clouds, etc. LVI isn't gauged as a very practical attack at least according to Intel and some university researchers, but Bitdefender who co-discovered LVI say it could be used as a basis for future real-world attacks and as shown by these benchmarks the performance is another troubling set-back if these options need to be used liberally when compiling software.

The performance impact from these LVI mitigation switches are likely the largest we've seen since we began benchmarking the security mitigations following Spectre and Meltdown. The LVI mitigation impact is of similar scope to last year's JCC Erratum in that pure user-space applications can be affected and not contingent upon frequent context switching or other specific kernel interaction. Going LFENCE-happy understandably takes a big toll on performance and we hope the guidance doesn't change stemming from any future disclosures that would need to make using these assembler options more recommended. Of the three assembler options, the most impactful is the issuing of an LFENCE after every load instruction while having the extra LFENCE instructions before indirect branches and before ret instructions were also measurable. Thankfully the very latest Intel CPUs such as newer Coffee Lake parts, Comet Lake, and Cascade Lake are said to be largely unaffected while Ice Lake is not vulnerable at all.

If you enjoyed this article consider joining Phoronix Premium to view this site ad-free, multi-page articles on a single page, and other benefits. PayPal or Stripe tips are also graciously accepted. Thanks for your support.


Related Articles
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.