Slashdot Mirror


Another Day, Another Intel CPU Security Hole: Lazy State (zdnet.com)

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.

21 of 110 comments (clear)

  1. Awesome... by jwhyche · · Score: 3

    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.

    --
    I read at +2. If your post doesn't reach that level I will not see or respond to it.
    1. Re:Awesome... by Anonymous Coward · · 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.

    2. Re:Awesome... by PopeRatzo · · Score: 2

      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.

      I thought AMD and ARM cpus were also susceptible to exploits. Is that wrong?

      --
      You are welcome on my lawn.
    3. Re:Awesome... by jwhyche · · Score: 3

      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.

      --
      I read at +2. If your post doesn't reach that level I will not see or respond to it.
    4. Re:Awesome... by drinkypoo · · Score: 4, 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.

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
    5. Re:Awesome... by sjames · · Score: 2

      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.

    6. Re:Awesome... by jwhyche · · Score: 2

      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 tossed at it.

      The R-2700 does lag behind in single threaded areas over the i7-8700K, which is where most gaming performance would be. But from what I've seen that lag really isn't enough to matter. Almost all game performance issues today are caused by poor GPU performance. Any modern CPU should be more than capable of feeding a GPU.

      I'm heavy into Second Life, (no really why are you looking at me like that?), and do a lot of 4K gaming. So far I have never seen my i7-6700K break more than 30% on anything. Even with all the settings maxed out on the game.

      If you want to stick to intel and can wait the Iccy Lake CPUs are supposed to be out in first quarter of '19. These are expected to address the flaws in hardware that intel has been having.

      --
      I read at +2. If your post doesn't reach that level I will not see or respond to it.
    7. Re:Awesome... by PopeRatzo · · Score: 2

      I'm heavy into Second Life

      I respect you for being willing to admit that publicly.

      --
      You are welcome on my lawn.
    8. Re:Awesome... by sjames · · Score: 2

      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 the Meltdown patches are applied.

    9. Re:Awesome... by jwhyche · · Score: 3

      I respect you for being willing to admit that publicly.

      I keep telling myself that it's better than hookers and blow.

      --
      I read at +2. If your post doesn't reach that level I will not see or respond to it.
    10. Re: Awesome... by Mkkby · · Score: 2

      I'm starting to think x86 CPU performance gains (especially intel) the past 10 years are nothing but a marketing scam. If you turn good security practices back on, these chips will likely be much slower and not worth half the price.

      I think we are looking at end of life for x86. You can choose fast processors that are full of security holes (i.e. never use them in a cloud), or you can choose much slower processors that are safe for clouds.

      Smart companies and individuals can use the fast/unsafe chips because we host our own apps and never let strangers share computer resources.

    11. Re:Awesome... by Ramze · · Score: 4, 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.

  2. "regardless of your operating system" by QuietLagoon · · Score: 5, Informative
    Yet the linked article says

    ...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. ...

  3. Go AMD by zippo01 · · Score: 4, Interesting

    AMD should be dumping money right now. Making all this as public as possible and pushing its own CPU's Go AMD go!

    1. Re:Go AMD by drinkypoo · · Score: 3, 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.

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
  4. Time for fewer optimizations? by davidwr · · 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).

    --
    Knowledge is how to play a game, intelligence is how to win, wisdom is knowing what game to play.
  5. Re:Floating point registers are used for encryptio by Anonymous Coward · · 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 counters, pointers and so on. This was especially true on 32 bit, where out of the 8 registers, the stack pointer (ESP) cannot be used for anything else, the frame pointer (EBP) may be needed for debugging/dynamic allocation, and EBX is used for addressing in position-independent code (all libraries). In many cases, the compiler was (32 bit is obsolete) left with 5 or 6 registers to play with.

  6. Intel vs. the rest of the world by DrYak · · 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. 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.

    --
    "Sufficiently advanced satire is indistinguishable from reality." - [Tips: 1DrYakQDKCQ6y52z6QbnkxHXAocMZJE61o ]
  7. Different standard of disclosure by DrYak · · Score: 3, Insightful

    Where's the tablet-optimised website? This one's just a few tweets, 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.

    --
    "Sufficiently advanced satire is indistinguishable from reality." - [Tips: 1DrYakQDKCQ6y52z6QbnkxHXAocMZJE61o ]
  8. Shared register, indeed ! by DrYak · · Score: 4, 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), 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).

    --
    "Sufficiently advanced satire is indistinguishable from reality." - [Tips: 1DrYakQDKCQ6y52z6QbnkxHXAocMZJE61o ]
  9. Rasbperry Pi! by DrYak · · Score: 2

    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.

    --
    "Sufficiently advanced satire is indistinguishable from reality." - [Tips: 1DrYakQDKCQ6y52z6QbnkxHXAocMZJE61o ]