Another Day, Another Intel CPU Security Hole: Lazy State (zdnet.com) 110
Steven J. Vaughan-Nichols, writing for ZDNet: The latest Intel revelation, Lazy FP state restore, can theoretically pull data from your programs, including encryption software, from your computer regardless of your operating system. Like its forebears, this is a speculative execution vulnerability. In an interview, Red Hat Computer Architect Jon Masters explained: "It affects Intel designs similar to variant 3-a of the previous stuff, but it's NOT Meltdown." Still, "it allows the floating point registers to be leaked from another process, but alas that means the same registers as used for crypto, etc." Lazy State does not affect AMD processors.
This vulnerability exists because modern CPUs include many registers (internal memory) that represent the state of each running application. Saving and restoring this state when switching from one application to another takes time. As a performance optimization, this may be done "lazily" (i.e., when needed) and that is where the problem hides. This vulnerability exploits "lazy state restore" by allowing an attacker to obtain information about the activity of other applications, including encryption operations. Further reading: Twitter thread by security researcher Colin Percival, BleepingComputer, and HotHardware.
This vulnerability exists because modern CPUs include many registers (internal memory) that represent the state of each running application. Saving and restoring this state when switching from one application to another takes time. As a performance optimization, this may be done "lazily" (i.e., when needed) and that is where the problem hides. This vulnerability exploits "lazy state restore" by allowing an attacker to obtain information about the activity of other applications, including encryption operations. Further reading: Twitter thread by security researcher Colin Percival, BleepingComputer, and HotHardware.
Awesome... (Score:4)
This just keeps getting better and better. "Hey, I got a ideal! I'm going to switch to intel for this build." I thought to myself. I wasn't even smoking any good weed when I did that, or bad weed. Nope, my dumbassery was my own fault.
Re: (Score:1)
Intel architecture appears to be riddled with this kind of stuff. AMD will be my next machine. Thank flying-spaghetti-monster that Ryzen is decent.
Re: (Score:2)
Re:Awesome... (Score:5, Interesting)
nope. Meltdown was an Intel exclusive. Both AMD and Intel run speculative code, but the difference is AMD checked privileges before running speculative code. Intel checked AFTER running it -- meaning unauthorized code could be run before being cleared. That means AMD took a performance hit, but Intel had all kinds of info left in the cache that shouldn't be there so other processes could snoop on things that they shouldn't have privileges to access -- possibly passwords, memory locations, file locations, output for programs that should not have had authorization to run, etc.
Intel's work-around was to clear the cache whenever switching between code of different privileges. That's right -- they dump the cache memory every time a program accesses something of a higher security level so that there's nothing there for a rogue program to access something that's not on its same security level. Side effect being that an empty cache has to be refilled to properly speed up the CPU operations. Things that don't switch much aren't affected much, but some things are severely impacted.
Intel intends to fix this in a few years by changing the silicon to check FIRST -- like AMD does. It takes 2-3 years to design a new processor, though... and I doubt they'll get it in the 2019 silicon. Supposedly, they'll have a quick fix for 2019 silicon and a proper fix for 2020/2021, but who knows. They have been suffering from manufacturing delays b/c they're trying to squeeze the most the can out of outdated lithography and are getting high defects. My bet is the fixes will come when they jump to 7 nm.
Re:Awesome... (Score:5, Interesting)
This was posted to a blog in 2015:
As someone who worked in an Intel Validation group for SOCs until mid-2014, I can tell you, yes, you will see more CPU bugs from Intel than you have in the past.
Why?
In late in 2013 there were meetings with all the validation groups. Head honcho in charge of Validation says something to the effect of: "We need to move faster. Validation is taking much longer than it does for our competition. We need to do whatever we can to reduce those times... we can't live forever in the shadow of the 90's FDIV bug, we need to move on. Our competition is moving much faster than we are." (I'm paraphrasing. )
Many of us were aghast that someone highly placed would suggest we needed to cut corners in validation. That wasn't explicitly said, of course, but that was the implicit message.
Re: (Score:2)
Dupe:
https://bsd.slashdot.org/comme... [slashdot.org]
Re: (Score:3)
I thought AMD and ARM cpus were also susceptible to exploits. Is that wrong?
Re:Awesome... (Score:4)
I thought AMD and ARM cpus were also susceptible to exploits. Is that wrong?
No, you are not wrong. I would go so far as to say that a modern CPU is probably one of the most complex machines on the planet. There are bound to be bugs and exploits in all of them. I'm just suffering from a case of buyers regret I believe.
Re: (Score:2)
I've been looking to build two new machines - one for music production and another for gaming. Do I have to worry about this crap? I was going to start ordering parts when all this started coming out. You think I should just wait?
Re: (Score:2)
I've been looking to build two new machines - one for music production and another for gaming. Do I have to worry about this crap? I was going to start ordering parts when all this started coming out. You think I should just wait?
My understanding is that Meltdown and Spectre require access to the physical device. I don't know if this is the same for the new exploit. Some parts of the exploits can be mitigated by OS, firmware, and BIOS updates, but it requires a CPU redesign to truly solve the issue. In my mind, any exploit that requires physical access is less of a concern than exploits that can be leveraged through malware. The reason is that once someone has physical access to your system I figure that you're screwed anyway.
Re: (Score:1)
Re: (Score:2)
As others have stated, it doesn't technically require a user to choose to run something. A simple web page with javascript can do it without even prompting you.
Still, Meltdown was the worst because it actually ran code that didn't have the user rights to run. AMD checked permissions before running anything; Intel ran everything and checked AFTER -- leaving data in the cache for other processes to find that it shouldn't have.
But, the fixes for Meltdown and various Spectre variants should also make it much
Re: (Score:3)
Do I have to worry about this crap? I was going to start ordering parts when all this started coming out. You think I should just wait?
Honestly, I think that would depend on your needs, vs how you feel about the current crop of Intel and AMD chips. Despite all my griping about it I'm more than satisfied by the performance of my i7-6700K. Both in gaming and more mundane tasks.
If you are not comfortable with Intel by all means look at what AMD has to offer, I'm thinking of the R-2700 processor here vs the i7-8700K. The R-2700 is priced competitively with the i7-8700K and yet beats it in virtually every multi-threaded test I've seen t
Re: (Score:3)
I respect you for being willing to admit that publicly.
Re:Awesome... (Score:4)
I respect you for being willing to admit that publicly.
I keep telling myself that it's better than hookers and blow.
Re: (Score:2)
Hate to break it to you, either one is better, and when combined!!!
Just don't get too carried away, and pawn your computer, you'll need something to do once the moneys gone:)
Re: (Score:1)
Once Intel releases a CPU without all these crappy vulnerabilities, BE ASSURED it will be at a premium. They'll call it a feature. "Now without Meltdown / Spectre vulnerabilities, only 5x the cost of the previous generation!"
If Intel doesn't artificially bump up the price, the demand will surely outpace supply.
Re: (Score:1)
Re:Awesome... (Score:5, Informative)
I thought AMD and ARM cpus were also susceptible to exploits. Is that wrong?
You're not wrong, but AMD processors are [so far] susceptible to less exploits related to speculative execution, and the scope of vulnerability is also less than in the case of the Intel processors in the cases where they are vulnerable.
The bit in the brackets there is the potential rub, but [so far] I'm feeling fairly smug about using AMD processors in my builds for years and years now. I thought being able to upgrade piecemeal for so long due to AMD's user-and-OEM-friendly practice of supporting CPU sockets for long periods was great, and the price difference fantastic, but the apparent fact that they care more about security than Intel might just be the best part.
Intel vs. the rest of the world (Score:5, Informative)
I thought AMD and ARM cpus were also susceptible to exploits. Is that wrong?
Indeed lots of different CPU manufacturer could be producing CPUs susceptible to spectre vulnerabilities.
But not all CPU are created equal.
There are some key differences :
- not all CPUs actually do speculative execution. only a couple of ARM core actually do [arm.com]. The huge remaining amount doesn't and thus can't in any way be subjected to Spectre class vulnerabilities.
(Even some of Intel's own core, like some older Atom, or like Xeon Phi GPGPUs don't do speculative execution)
Intel has a different safety vs optimization threshold than most of others:
- with most other CPU manufacturer, Spectre vulnerabilities boil down to "access memory region to which the process should already have had read access anyway" (see v1 and v4), thus it could be already addressed by safe practice (v1: don't put 3rd-provided JIT code and crucial information in the same process. e.g.: a browser's JIT engine running webpage's scripts and the password manager should not be in the same process) (v4: always clean up your stack before bailing out if it could contain cricital data, or better keep all the critical data in some specific mapped pages), etc.
- Intel tends to push performance first to the detriment of anything else : some security test coming in too late.
AMD and most ARM won't speculate past memory protection. If a memory region is blocked from access for the process (generally : kernel memory), AMD will check the memory protection and never attempt to access the restricted region to begin with. Whereas Intel CPUs will speculatively access the restricted region and only do the check much latter, by which point the usual Spectre's cache loading side-channel leakage could have happened.
(There are few select ARM which are susceptible to Spectre v3a. Basically the same concept, but regarding system-reserved register - this being RISC architecture, with tons of registers)
AMD and ARM will honor non-maskable interrupt. In today's vulnerability Intel tries to speculatively execute the point past which the system should contect switch the FPU registers (which includes stuff like SSE and AVX registers. i.e.: an attacker could be speculatively peeking into what another process did with these - SIMD operations with SSE/AVX are used in encryption/decryption, so an attacker could occasionnally spot what other process are decrypting/encrypting and whith which keys)
So you end up with vulnerabilities v3 and today's which are Intel exclusive.
Also Intel tends to be a tiny bit more aggressive and/or jumping through some shortcut and/or having way deeper pipeline and longer speculations, in order to shave a few cycles off :
end results :
v2 (Indirect Branch prediction) is currently successfully exploitable on Intel. Though in theory some AMD CPU could do speculative indirect branching, there are no current usable exploits in the wild.
v1 actually works on Intel CPU without even activating the JIT - the speculation is so deep that an bytecode interpreter could speculatively access stuff
v4 works much easier on Intel (deeper pipeline higher chance to manage to read something that wasn't erased from memory yet)
etc.
TL;DR: due to technical choices prioritizing performance, Intel CPU tend to be even more vulnerable.
Re: (Score:2)
The problems with AMD parts are much less severe. The fixes don't cripple your performance.
I'm so glad I got Intel to buy me an AMD.
Re: (Score:3)
In part.
AMD and ARM have some similar flaws but they are harder to exploit and the performance costs of preventing exploitation are smaller.
Intel has more flaws and they are much more exploitable. Intel have put considerable effort into sewing confusion on that point, doing their best to leave the false impression that all CPUs are equally problematic.
Re: (Score:2)
So, you think I should probably wait before building two new Intel-based systems?
I've been burned using AMD cpus on music production and gaming platforms before. I'm not prepared to go back to try them again, yet.
Re: (Score:3)
I would strongly consider waiting. The performance you see now may drop considerably once all the patches (microcode, OS, and user applications) are in.
It is probably worth your time to research the latest generation AMD, especially if the software you will be using is multi-threaded. Historically, Intel has had better single thread performance, but AMD has provided more bang for the buck if you use all of the cores. The latest generation looks like it beats Intel single threaded as well, especially once th
Re: (Score:2)
OK. So maybe I'll try one of the fast Ryzen processors for the music production machine and hold off and use Intel for the gaming machine.
Thanks, sjames.
"regardless of your operating system" (Score:5, Informative)
...For some operating systems, the fix is already in. Red Hat Enterprise Linux (RHEL) 7 automatically defaults to (safe) "eager" floating point restore on all recent x86-64 microprocessors (approximately 2012 and later) implementing the "XSAVEOPT" extension. Therefore, most RHEL 7 users won't need to take any corrective action.
Other operating systems believed to be safe are any Linux version using the 2016's Linux 4.9 or newer kernel. The Linux kernel developers are patching older kernels. Most versions of Windows, including Server 2016 and Windows 10. are believed to be safe. If you're still using Windows Server 2008, however, you will need a patch. The latest editions of OpenBSD and DragonflyBSD are immune, and there's a fix available for FreeBSD. ...
Go AMD (Score:5, Interesting)
Re:Go AMD (Score:4, Informative)
AMD should be dumping money right now. Making all this as public as possible
AMD has made their own security-related errors. While they appear to be less numerous (and less serious) than those of Intel, that could be because we simply haven't figured out where they screwed up yet. The fact that we keep getting news of new Intel vulnerabilities and not AMD ones when surely many, many people are scrutinizing products from both companies does suggest that Intel processors have more holes than AMD ones, but it doesn't prove anything.
Historically, both companies tout their advantages, and feel free to make public statements about ways they feel they have been wronged legally, but they don't trash-talk the competition for making mistakes. This is in fact more common than not in business; you'll see the same thing at work in the auto industry. Their talking heads fairly consistently shy away from kicking other players when they're down.
AMD is wise to focus on their successes, and to not even mention Intel's failures. CPUs are complicated products, and they are capable of making their own mistakes.
Re: (Score:2)
Re: (Score:2)
That's my experience. I like AMD's CPU's, but all the incompatibilities, instability, and general flakiness of the platform eventually drove me over to Intel. I still use their GPU's, mostly because as bad as their software and drivers may be, nVidia's are far worse.
And somewhat hilariously, I have found the same GPU with the same driver almost always works better on an Intel system than an AMD one.
Re: (Score:3, Informative)
Actually describing them as FP is misleading, they should be called the vector registers, they are wide (128, 256 or 512 bits) and while all (except legacy x87) FP instructions only work on these registers, there are plenty of instructions which use them as fixed size arrays of 8, 16, 32, and even 64 bit integers.
Of course you could perform the same tasks on the regular 64 (formerly 32) bit registers but this would be much slower. Using the vector register file also frees the integer registers to be used as
Re: (Score:2)
In many cases, the compiler was (32 bit is obsolete) left with 5 or 6 registers to play with.
And of those registers, two or three of them are the mandatory locations for input and output of instructions, meaning that x86 effectively only has two or three general purpose registers.
Shared register, indeed ! (Score:5, Informative)
Floating point registers are used for encryption?
This doesn't make any sense to me, unless they're actually shared registers.
Exactly :
the FP registers are shared with integer SIMD registers
(FP87 and MMX are exactly the same register file under a different name, modern CPU tend to use AVX/SSE for their floating point computation and use the same registers also for interger SIMD, etc.)
Basically (As cpercieval explained in his Twitter thread), the CPU will only always switch the content of its basic CPU registers (rax, rbx, etc.)
Everything else (e.g.: SSE's xmm0, xmm1, etc) will only be switch when needed (though a non maskable interrupt). But just like with Meltdown Intel CPUs didn't give a fuck about memory protection, in this spectre vulnerability Intel CPU don't give a fuck about context switching and will happily speculatively execute and process old left-over data in these registers.
The problems is that most efficient crypto implementation are likely to be implemented using MMX, SSE or AVX (including the AESNI hardware [felixcloutier.com]), thus critical data is likely to be hanging in these registers when a process that handle encryption is interrupted and multi-task-switched to the attacker's process.
On any other CPU, if the attacker's process attempts to access of there registers, the process will immediately be interrupted, and the kernel will also switch the FP/MMX/SSE/AVX context (the process will only see it's own content of XMMn).
On Intel hardware, the CPU will happily try to speculatively continue executing based on the old stale content of the XMMn register (which could be containing the data that the encrypting process was manipulating), enabling possibility to leak through the usual spectre's cache side-channel, until the NMI is served the correct context is loaded and the speculative attempt thrown away.
Sounds stupid, but it enables Intel CPU to show a couple of % faster on benchmarks.
e,g,; benchmarks that do encryption are less likely to be hit performance-wise by multi-tasking :
in the case of switching an encryption process -> normal CPU process -> back to the encryption process, a normal CPU (like AMD) will lose time forcing a reload of the SSE/AVX context when returning to the encryption.
An Intel CPU will happily continue immediately the encryption with the content of the XMMn registers, and speculative execution will eventually turn being right as the left-over data in the XMMn registers is the encryption's own content from right before getting interrupted by the CPU-only thread (which left it untouched).
Re: (Score:2)
I think these flaws work approximately like this: Process 1 ensures that memory location X is in the cache (by accessing it), while memory location Y is not in the cache (by accessing enough other locations that location Y gets flushed out); then process 1 yields the processor to other processes.
The scheduler runs process 2 for a while. Eventually, process 1 is scheduled for execution again.
Then, when process 1 gets the processor back, some registers contain data that belong to process 2. If process 1 uses
Cache side-channels (Score:2)
Roughly yes.
Except that: instead of comparing on X versus Y, you can make a giant array of Y with lots of pages, and for each possible value of b that you want to snoop on, you make sure to load a different page. (So if you want to distinguish between 16 values of b, and Y is stored in a region that is cached into 16k pages, you allocate 256k for the Y array).
And then process 1 measures timing access to each chunk of array Y to see which one was already loaded into cache. (not necessarily on the same pass)
Time for fewer optimizations? (Score:5, Interesting)
For some types of chips and applications, perhaps having real security means not being able to do fancy optimizations that degrade security.
I wonder how well typical PC operating systems would work if they were re-compiled to not take advantage of optimizations and run on a completely-de-optimized architecture-compatible CPU with buses, memory, chipsets, etc. that were similarly "de-optimized" and had other things in them like less-tightly-packed circuits to prevent certain side-channel attacks (e.g. rowhammer).
Re: Time for fewer optimizations? (Score:1)
You mean ENIAC?
Re: (Score:1)
Speculation is a big part of performance in modern superscalar architecture... but it comes with an inerrant risk of side-channel attacks which is difficult to completely eliminate the possibility of. If you were to remove it all, we are talking at least one order of magnitude performance reduction... even then you have all the potential side-channel attacks left of things without speculation like simply _having_ caches, and physical attributes of memory like rowhammer. The good news is it's really not nece
"and more thoughtfully applied - if at all" (Score:1)
The good news is it's really not necessary to go that far back, it's just the more excessive optimisations that need to be scaled back and more thoughtfully applied - if at all.
This.
Rasbperry Pi! (Score:3)
I wonder how well typical PC operating systems would work {...}
Well lots of smartphones and nearly all single-board computers (including the Pi) use ARM core that don't do any speculative execution.
(Only very few high-performance smartphones use ARM with speculative exec and thus potentially spectre-vulnerable)
They are still not that bad at common browsing tasks.
Re: (Score:2)
Most current "flagship" phones use multicore CPUs in big.LITTLE configuration.
In most of these the "big" part are cores with speculative execution, which are activated when there is a need for more power. Most exploits in the class that Spectre is in need to first prime the cache and speculator through code in long-running loops (and especially on ARM), which means that they would always be promoted to run on the "big" cores anyway.
I wrote "most phones" above, because some SoC:s, like Snapdragon 835 and 845
Safe mode / simple mode, for encryption operations (Score:2)
"Fixing" these will go on forever, probably, because there are all kinds of side channels enabled by the fact that modern CPUs use many different optimizations. They aren't the simple machines they look like from the software side. Disabling all of those optimizations would have a significant impact on performance.
Modern processors switch between various modes a million times per second. One way to get the best of both security and performance would be to have a security mode, in which all caches and such a
Fix improves performance? Smells like BS. (Score:2)
TFA includes a claim that the fix for this hole will actually improve performance. I don't see how that's possible - the problem is caused by a feature that improves performance, and the fix, as I understand it, is simply to not use that feature. Is there something I'm missing?
Re: (Score:1)
No, you aren't missing a thing. Most optimizations that improve performance while not using lazy state saving should improve performance while using lazy state saving.
Either that or the lazy state saving implementation was seriously borked in the first place.
Listing Lazily (Score:2)
They're listing lazily to the left. Boy, this guy knows some maneuvers.
Where are the fines? (Score:2)
VW plays fast and loose with diesel emissions to gain performance, and is fined billions. Intel plays fast and loose with speculative execution to gain performance, and...nothing.
While Intel hasn't broken any regulations (AFAIK), they have sold defective goods, likely deliberately. It's time for them to at least reimburse all customers for the damages.
No wonder... (Score:2)
No wonder intel is so much faster... they skipped all the fking checks. I've now got $100m of virtualised hardware which can be hacked.
Nice..
Horrible year (Score:2)
TFA says "What a horrible year in security for Intel".
It was mostly horrible for Intel's customers.
Re: (Score:2)
It was mostly horrible for Intel's customers.
Looks like they got what they deserved. They supported Intel through their anticompetitive assaults on AMD, and now they reap what they've sown.
Different standard of disclosure (Score:4, Insightful)
Where's the tablet-optimised website? This one's just a few tweets [twitter.com], it doesn't even have a logo! Where's the superbowl ad?
In an era where every single vulnerabilities needs to get a catchy name and a well designed reactive website (almost a superbowl ad ?), even before confirming if there's a viable exploit, it's nice to see the big hats of security reacting (cpercival - the daddy of Scrypt) and taking time to write an actual exploit to test, even if communication is done over an unglamorous channel as twitter.