11 ms·
A Look at the CPU Security Mitigation Costs Three Years After Spectre/Meltdown
- aftbit 6y agoI wonder how the Apple M1 hardware stacks up. I don't know if they are vulnerable to any existing Spectre attacks but surely they are still using speculative execution and thus have to be aware of similar side-channels.
- mhh__ 6y agoCould someone with an M1 try and run some Spectre gadgets? Obviously read the source first but there are a few implementations of the basic ones on GitHub, not sure about the higher versions of spectre (I don't know whether CVE's require an implementation to be published). If I can find I'll link a paper that describes a system to try to automatically characterize these types of side channels.
- ljhsiung 6y agoIncredibly doubtful. Current attacks are, by this point, pretty well understood. One can simply "check off the list" of attacks and simulate the code gadgets to see what happens (EDIT: e.g. https://github.com/IAIK/transientfail https://github.com/IAIK/transientfail provides a SoK with simple PoCs). In other words, I'm positive that no "script kiddie" can exploit any silicon using current attacks, not just the M1. * The more difficult/interesting problem is being future-proof to whatever else undiscovered. Many Spectre attacks are heavily timing based, and even a single cycle variation in pipeline stages or flushing structures will spawn a new variant (see, MDS vs. Spectre). This is actually partially why a current trend in hardware research is trending towards fuzzing-type stuff [1]. Something also worth noting is that it's incredibly difficult to quantify "leakage". There's a pretty big difference between vulnerable and exploitable-- e.g. original Spectre papers had 10KB/s of kernel dumping, which is a big reason it was scary, but would it really be a big deal if it had <1b/s? Not going to explicitly name and shame, but there've been a handful of reasonable high profile "vulns" with cute domain names that I'm shocked to even see accepted at conferences due to how contrived the exploit was and tiny their leakage rates were. I personally don't really know how to address the quantification problem, but I very much think it's necessary in any discussion of a bug's impact/severity. Definitely gets exhausting when every cute name gets a headline, and it's easy to blow things out of proportion without some grounding in reality. * NOTE: I do think script kiddies have their place still. Definitely important to have automation to determine whether a system has updated security [2], it's just that I doubt such a scenario is applicable to Apple. [1] https://www.usenix.org/conference/usenixsecurity20/presentation/moghimi-medusa https://www.usenix.org/conference/usenixsecurity20/presentat... [2] https://owasp.org/www-project-top-ten/2017/A6_2017-Security_Misconfiguration https://owasp.org/www-project-top-ten/2017/A6_2017-Security_...
- eloff 6y ago> I'm positive that no "script kiddie" can exploit any silicon using current attacks, not just the M1. * Oh, do tell how spectre is solved. I would love to know, defending against it is a real problem I currently have. If you allow untrusted code to execute on your machine (e.g. JavaScript) then you're vulnerable to it. There are no practical attacks in the wild that I'm aware of, and it's tricky to do, but it's not impossible and the only defense really is to make it harder and more time consuming. This is the approach that I and others have taken.
- ljhsiung 6y agoRun this [1]. If it works, flush your caches or just update your kernel. If it doesn't, you checked off an item on your list. I misspoke, silicon should be more like "system". Said it in this comment more about silicon fixes https://news.ycombinator.com/item?id=25665276 https://news.ycombinator.com/item?id=25665276 [1] https://gist.github.com/anonymous/99a72c9c1003f8ae0707b4927ec1bd8a https://gist.github.com/anonymous/99a72c9c1003f8ae0707b4927e...
- eloff 6y agoI don't think you understand spectre. Defending against a single POC is not the same thing as defending against this class of side channel vulnerabilities. Also your references to flushing caches and updating the kernel underlines to me that you don't know what you're talking about.
- ljhsiung 6y ago>> One can simply "check off the list" of attacks >> The more difficult/interesting problem is being future-proof
- eloff 6y agoI feel like you're not communicating well here. What does checking an attack off your list mean to you? If it means you're safe from it now and in the future, then obviously you're wrong. I feel like that's a strawman and not your actual argument though.
- raxxorrax 6y agoI think there still aren't any spectre/meltdown attacks, just proof of concepts. On my home PC I might deactivate mitigation since I rarely execute unknown code. On the other hand CPU power isn't really a bottleneck for me. It is a memory leakage problem and in the world of today with apps stealing info left and right, I am almost unsure if I should care about it that much. Maybe attackers might be able to steal a key here and there, but I managed to stay quite cool when the architectural flaws were published. I believe I saw a demonstration about the M1 not being affected by these side channel attacks, but I have no source.
- fareesh 6y agoIs it possible to attack via JS/WASM through the browser? That's pretty much the only unknown code I am running.
- marcosdumay 6y agoIn theory, yes, it should be possible. But I don't think anybody managed to, due to the amount of noise the browsers sandboxes add into the necessary syscalls.
- kllrnohj 6y agoThat's not true at all. Some of the first proof of concept attacks were done in JS. Now the question would be are those attacks still viable given the additional hardening browsers have done independent of the kernel mitigations?
- benibela 6y agoThat is why I got NoScript when the attacks were discovered Although many pages do not work with it, so I disable it quite often I wonder if it is possible to activate the mitigations only for the browser? Or only for one user? I have created a separate user for the browser, so it cannot change my actual files
- kllrnohj 6y agoAlmost certainly the M1 is still "vulnerable" to the same attacks that other current gen CPUs are. The M1 is of course a speculating CPU (and quite a deep one at that), and there doesn't appear to be any rollback for modifications to L1/L2 during that speculation when a branch miss occurs.
- Neil44 6y agoSurprised to see significant mitigation penalties even on newer CPUs.
- mhh__ 6y agoUltimately spectre mitigations mean fiddling with the speculative execution, which means a real paradigm shift microarchitecturally. The literature is still very thin too, so we're still very much in the early days of these side channels.
- whbrown 6y agoHyper-threading (along with some forms of speculative execution which become subject to side channel attacks) is another example of a performance enabling technology with unforeseen security vulnerabilities which are nowadays required to be disabled. With the death of Moore's law [1], it's not too surprising that newer CPUs (or at least x86 ones) are still recoiling from Spectre and Meltdown et al. [1] https://youtu.be/MtrZJ4UqSn8?t=1327 https://youtu.be/MtrZJ4UqSn8?t=1327
- Skunkleton 6y agoCPUs are still very much superscalar, and hyperthreading still exists most places.
- ljhsiung 6y agoCurrent mitigations are still largely software based, and frankly, aren't fundamentally any different than the ones proposed just a couple days after 1/3/2018. Additionally, current academic literature still hasn't addressed proper silicon mitigations in an all too performant manner-- around 7-15% penalty from what I've seen. While in my opinion, some of these mitigations are provably future-proof (and very genius!), those penalties are still quite heavy. Furthermore, if software yields similar penalties, then why not just stick with software mitigations? Just look at the mitigations list of i9 10900k or Ryzen 9 5950X as used in the article, both released in latter half of 2020. >> itlb_multihit: Not affected + l1tf: Not affected + mds: Not affected + meltdown: Not affected + spec_store_bypass: Mitigation of SSB disabled via prctl and seccomp + spectre_v1: Mitigation of usercopy/swapgs barriers and __user pointer sanitization + spectre_v2: Mitigation of Full AMD retpoline IBPB: conditional IBRS_FW STIBP: always-on RSB filling + srbds: Not affected + tsx_async_abort: Not affected Many of these are still by and large "disable this optimization" and "barriers", all done in software, with the potential exception of EIBRS which just essentially tags the branch predictors (which, in my opinion, they don't do in a particularly effective way, but stay tuned for Research tm). Also Meltdown, which I think is a pretty easy fix, and even Intel agreed [1]. Given typical design --> market time might be ~2 years, designers only had a few months to 1) finish currently pipelined work and 2) work on mitigations. On top of that, given that this is a pretty hard problem, a few months (not even > 1 year IMO) is definitely not enough time. I'd guess that this problem won't be "solved" in a sense for many many more years, much in the same way that the rich history of buffer overflows has been a cat and mouse game for decades, with each mitigation coming with its own tradeoffs and potential performance penalties. On the "Hardware Mitigations" side, think of ARM's pointer authentication-- it's only just now that some pretty nice hardware support has been spawned, decades after buffer overflows were "known". Still though, I personally think some more silicon mitigations will come in the next 2 years. Part of the reason "Pointer Auth" came "decades after buffer overflows" is due to the rise of cloud compute, and security matters much much more to the general public these days. I just mentioned current research generally has penalties on the order of 10%-- While pretty distasteful, it can definitely be (and has been) gradually improved on and is a far step from initial estimates of ~33-50%. [1] https://www.rockpapershotgun.com/2018/01/29/intel-cannon-lake-ice-lake-spectre-meltdown-fix/ https://www.rockpapershotgun.com/2018/01/29/intel-cannon-lak...
- wnevets 6y agoIf you're on windows you can easily turn them off with inspectre from grc [1] [1] https://www.grc.com/inspectre.htm https://www.grc.com/inspectre.htm
- martinesko36 6y agoDoes turning them off improve performance?
- coolspot 6y agoYes, very significantly, especially on old CPUs that don’t have hardware mitigations.
- wokkel 6y agoI've read the word "mitigation" so much (not only here, and not only you; so this comment is not directed at you personally) that I only hear doublespeak now: when people say mitigation I immediately think of a slab of concrete in the back of my car to compensate for not having any brakes installed. Please recognize for what it is: a design failure that is pampered upon. A mitigation is not a solution, it lessens the impact of the failure mode that was identified. Afaik, if the flushes and changes actually work, it is not a mitigation but a workaround: the failure mode cannot occur anymore. Mitigation sounds better than workaround though (and is probably the reason it was choosen).
- coolspot 6y ago
- 90red 6y agoWhat I personally learned? Never trust any hardware manufacture for anything other than security theater.
- recursive 6y agoAnd what then? Never use hardware?
- stainforth 6y agoI assume there are people here that can state in general what kind of performance drops they've seen since security patching?
- toast0 6y agoThere is no in-general. It is very use case specific. If you're doing media encoding, it would be hard to measure. If you're doing an haproxy tcp proxy, it's big. If you're doing https, it's probably not so big (encryption eats enough cycles that you wouldn't necessarily see the slowdown).
- sephamorr 6y agoI couldn't find it in the article if it was addressed, but I'd like to see 2017-era microcode used in the mitigations=off testing as well, to see how much of a difference that makes.
- vthriller 6y agoI also wonder if there are changes to the kernel that can't be reversed with a simple mitigations=off and what effect compiler-based retpoline hacks have these days. Wouldn't be surprised if there's some other variable that I'm missing.
- pstrateman 6y agoThe context switching thing is the biggest. If you have something that's just making a huge number of syscall's in a tight loop the mitigations absolutely dumpster performance.
- alblue 6y agoIt can be mitigated somewhat if you have pcid enabled for the processors, so that a flush can be process specific instead of cpu-wide. There’s still a performance hit of course but you’re going to lose some locality with a context switch anyway.
- justaguy88 6y agoWhy are they still releasing new CPUs with these issues?
- akersten 6y agoCheaper to keep the mitigations in place than to design around the side channel. Rearchitechting an entire CPU seems like it would be a boondoggle. Especially since the well of side channels runs infinity deep unless you're back to single core, single thread CPUs. As soon as they 'fix' this side channel, another will be found. It's just an inevitability of multi-tennant processing. I'd have preferred a hardware flag that says "I accept that if untrusted code runs on this CPU, I've already lost" and keep the performance boosts of speculation, but alas.
- modzu 6y agowell there's the mitigations=off kernel command-line switch in linux :)
- rincebrain 6y agoA few reasons. 1) It takes a long time for desired design changes to make it to fabs, so it was always going to take years for the classes of vuln that were discovered to get mitigated in hardware. 2) More have been discovered in the intervening period. 3) Speculative execution really speeds things up, so the fixes are removing/changing as little spec. ex as you think you can get away with, and leaving the rest.
- toast0 6y ago4) Intel's design pipeline is significantly messed up by its 10nm fab issues.
- theandrewbailey 6y agoI think the tick-tock strategy[0] was still salvageable when these vulnerabilities were discovered, and it would be reasonable to assume that the next tock would fix these. Isn't Intel's 10 nm mass production five years late? [0] https://en.wikipedia.org/wiki/Tick-tock_model https://en.wikipedia.org/wiki/Tick-tock_model
- esaym 6y agoI've given up tracking this stuff. Just been adding https://make-linux-fast-again.com/ https://make-linux-fast-again.com/ to my grub configs everwhere.
- edoceo 6y agoPlease, not in production systems
- deleted 6y ago[deleted]
- latch 6y agoWhy not? Or do you mean "please, not in a production system where you share a host"? If that's the case, I think you have it backwards. In production, please, don't share a host.
- numpad0 6y agoThere’s zero reason to change 8 digit passwords every 6 months if your /etc/passwd isn’t insecure
- teddyh 6y agoEven if you are OK with using that on a machine, that list of options absolutely reeks of magical thinking. On a modern Linux, a simple "mitigations=off" is equivalent to more than half of the other options listed, and many of the remaining listed options don't seem to exist anymore.
- colejohnson66 6y agoLike how some people still advocate for wiping hard drives with the Gutmann method (35 wipe passes)[0] when a single pass is more than sufficient for practically everyone?[a][b] [a]: Obviously, for absolute security, a hammer and/or a shredder does much better. [b]: This also ignores that the Gutmann method was designed for hard drive encoding methods that aren’t used anymore. [0]: https://en.wikipedia.org/wiki/Gutmann_method https://en.wikipedia.org/wiki/Gutmann_method
- jeffbee 6y agoThe interesting thing about these particular measurements is how they cut against the meme of AMD dancing on Intel's grave. The i9-10900K, a $500 part that's readily available, is 1st or 2nd place in many of these benchmarks, and where it's 2nd place it's to the quite unavailable and more expensive Ryzen 5000.
- neogodless 6y agoI personally don't think AMD is "dancing on Intel's grave." As much as I love (and try to buy) AMD's excellent CPUs, as you noted, the latest Ryzen 5000 series are in very limited supply, and I found the same with the Ryzen 4000 laptop chips all year. I eventually got an HP Omen 15 which I'm pretty happy with, but I'll remain bitter that options with brighter and/or faster screens or beefier graphic cards were never an option, and what options I had were often hard to find. As for the i9-10900K, if you check out a review from launch [0], you'll see nothing but good things to be said about the performance, with a very large trade-off of being a ridiculously power hungry, heat-producing CPU. If you're OK with that, then you're probably perfectly happy with the Intel CPU. For me, a cool and quiet CPU that can still smash my parallel processing needs and meet my gaming needs is a better sweet spot. [0] https://www.tomshardware.com/reviews/intel-core-i9-10900k-cpu-review/2 https://www.tomshardware.com/reviews/intel-core-i9-10900k-cp...
- Dylan16807 6y ago> more expensive Ryzen Only because this list happened to pick an expensive chip as the representative model for Ryzen 5000. For an even competition, look at the numbers for the 5800X and 5900X, which are respectively $50 cheaper and $50 more expensive. Compared to those, the 10900K isn't impressive. https://openbenchmarking.org/embed.php?i=2011098-FI-AMDRYZEN983&sha=26392a4eee24&p=2 https://openbenchmarking.org/embed.php?i=2011098-FI-AMDRYZEN... And the reason people got excited is not because Intel parts became useless, it's because AMD finally managed a generation of chips that flat-out beat Intel's, even in single core performance. Especially in light of how important a role AMD played in breaking the status quo of quad cores, putting fear in Intel's eyes is great for competition.
- 6y ago
- nuker 6y agoHow MacOS deals with it? Any slowdowns too?
- sparkling 6y agotldr: with all software-side mitigations turned on you are looking at ~15-25% decrease in performance. Considering the millions of chips running worldwide and the CPU cycles / energy wasted on this, this really is absolutely horrendous.
- Synaesthesia 6y agoConsider all the CPU energy "wasted" on playing games which contribute absolutely nothing to society.
- brutal_boi 6y agoI'm guessing you correlate that if peolpe didn't play games, they'd instead have time to do other things more meaningful to contribute to society, which is naive at best.
- prvc 6y agoCan anyone explain why the geometric mean in particular was used for the overall results?
- sgn 6y agoI think this paper should explain it https://dl.acm.org/doi/10.1145/5666.5673 https://dl.acm.org/doi/10.1145/5666.5673
- tux 6y agoSo can someone please explain to me if its better to use "mitigations=off" with Linux Kernel 5.10 or have the default from kernel with "AMD Phenom II X4 955 Processor"? By running "lscpu" I see only two lines in default mode (not using "mitigations=off" right now), everything else "Not affected"; Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization Vulnerability Spectre v2: Mitigation; Full AMD retpoline, STIBP disabled, RSB filling By having those it will affect my CPU perferomance? Will applying "mitigations=off" help with perfermance? Also by having "mitigations=off" what are the real security implications? Thank you for your help!
- grenoire 6y agoIt's really hard to define what a regular user is. You're your own commandeer and it's recommended that you try running benchmarks or using it under those two cases to determine if it's worth having mitigations or not. Considering all, the performance impact for your average Linux desktop user is likely not going to be unacceptable.
- flyinghamster 6y agoExactly. I just tried shutting off mitigations on an old laptop running BOINC, triggering the benchmarks before and after shutting them off. It made no difference whatsoever - not surprising, since that's compute-bound and isn't likely to have lots of system calls. How much that translates to the running applications remains to be seen.
- alisonkisk 6y agoThe performance part is either irrelevant or easy to measure. The security risk part is hard for most people to understand and make an informed decision. (Mitigation s ON is obviously safer, but even if I decide I want to go faster, I still don't understand the risk in taking.)
- justaj 6y agoAlso, are MDS attacks mitigated or not? I seem to remember that on their website [0] it said that the mitigations were not possible or extremely hard, but now it says that Intel has released patches. I'm wondering if those patches actually mitigate MDS attacks. 0: https://mdsattacks.com/#ridl-ng https://mdsattacks.com/#ridl-ng
- KingOfCoders 6y agoSo companies had security flaws in their design, the fix makes their CPUs a lot slower so you need to buy a new one from them earlier.
- dasKrokodil 6y agoI have a (maybe stupid) question about this. If we have the mitigations in place and compare two otherwise rather similar processors where one has hyperthreading and the other one doesn't (for example the Intel i7 7700 and the i5 7600), would there still be a significant difference in performance between them?
- deleted 6y ago[deleted]
- secondcoming 6y agoDoes anyone any numbers for turning these mitigations off on GCP instances? Especially for machines running Apache or nginx
- penguin_booze 6y agoIf anyone was wondering: cat /proc/cmdline