Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
AMD Security

How To Make Any AMD Zen CPU Always Generate 4 As a Random Number (theregister.com) 62

Slashdot reader headlessbrick writes: Google security researchers have discovered a way to bypass AMD's security, enabling them to load unofficial microcode into its processors and modify the silicon's behaviour at will. To demonstrate this, they created a microcode patch that forces the chips to always return 4 when asked for a random number.

Beyond simply allowing Google and others to customize AMD chips for both beneficial and potentially malicious purposes, this capability also undermines AMD's secure encrypted virtualization and root-of-trust security mechanisms.

Obligatory XKCD.
This discussion has been archived. No new comments can be posted.

How To Make Any AMD Zen CPU Always Generate 4 As a Random Number

Comments Filter:
  • Meh (Score:5, Funny)

    by ZiggyZiggyZig ( 5490070 ) on Sunday February 09, 2025 @05:39PM (#65154077)

    Why this on the front page? 4 is a perfectly valid random number!

  • I know this because I've read it on the internet many times.

    • Re: (Score:2, Informative)

      by thegarbz ( 1787294 )

      All you've done is demonstrate your inability to read. We've discussed AMD security flaws countless times here.

  • by Anonymous Coward on Sunday February 09, 2025 @06:04PM (#65154111)

    https://xkcd.com/221/ [xkcd.com]

    If this isn't deliberate I'll eat my hat.

  • by rahmrh ( 939610 ) on Sunday February 09, 2025 @06:11PM (#65154127)

    I am not sure how this is news.

    To update the microcode you need to either update the bios or get firmware placed on the machine for the kernel to load. If I can do either of those I OWN the machine anyway and can pretty much do anything to the OS and you can trust nothing.

    • by Viol8 ( 599362 )

      And if you look at the linux code they've written to do it , all it does is write a microcode binary to /dev/cpu/[id]/msr

    • by Bert64 ( 520050 )

      This.
      Plus there are plenty of reasons why you might want to modify the microcode.

    • by viperidaenz ( 2515578 ) on Sunday February 09, 2025 @06:49PM (#65154175)

      To update the microcode, you're supposed to have a signed binary to load. This bypasses the requirement to have a valid signature. Hence the titled "AMD: Microcode Signature Verification Vulnerability".

      If you have an exploit that allows local admin, or you are a local admin, this vulnerability escalates that to arbitrary microcode updates.

      This allows a local admin to bypass AMD Secure Encrypted Virtualisation, which is supposed to stop the local admin from accessing the guest VM.
      Congrats, some guy at Amazon can now access your secure VM running on AWS

      • by Bert64 ( 520050 )

        If your VM is running on someone else's hardware, then the owner of that hardware has access to it. Attempts to obfuscate it are just that - obfuscation, and there will always be a way around it.

        • by gweihir ( 88907 ) on Sunday February 09, 2025 @08:15PM (#65154331)

          Yep. Securing a VM against the host it runs on is wishful thinking. Worst case, the host can do partial emulation and then controls everything. There is no preventing something like that unless you do actual hardware machine partition (like mainframes can do) and that pretty much is the same as using separate machines. Not going to happen anytime soon with regular hardware.

          • by Bert64 ( 520050 )

            Even with physically separate machines, the machine still sits in someone else's datacenter. You have to trust your suppliers, and pretending you don't is just asking for trouble.

          • by sjames ( 1099 )

            Even then, you're depending on the mainframe operators doing what they said they would do and not leaving themselves a way to peek.

            • by gweihir ( 88907 )

              Indeed. And same for the mainframe suppliers. I trust, for example, IBM as far as I can throw them.

      • by fafalone ( 633739 ) on Monday February 10, 2025 @12:06AM (#65154563)
        It's my fucking computer and it pisses me off to no end that I'd have pay a lot of money to be permitted to write my own code for it that has to be inspected by the company first. This issue for drivers, CPU microcode, and anything else they're currently extorting money to write code for should have ended at needing to set a physical jumper to stop automated attacks and that's it. I don't know how to write custom microcode but Windows pulls this shit with drivers where the only way to run ones without paying an assload of money registering a company (individuals aren't allowed) and buying certs and begging for their blessing is to disable all kernel security every boot, which the drm and kernel anticheat fuckers then use as an excuse to not let you use things you pay for.
        This required signature scam is bullshit.
        • The CPU was never sold to you as something you can update the microcode yourself.

          This isn't the same as drivers for your OS.

          A physical jumper makes no sense. The microcode is stored in non-volatile memory in the CPU. It gets updated every time you boot it.
          If it's a bad update, or something happens during the load, a reset will fix it.
          Imagine how annoyed people would get if they bumped the reset button while their computer was booting, or the battery went flat at the wrong time and it bricked the CPU.
          Or the

          • The microcode is only updated when you download an update. The CPU shouldn't just be loading it off the hard drive every boot.
            • You may think it shouldn't, but it does.
              Not just the hard drive. The BIOS can update it too.
              The fact the CPU has no non-volatile writable memory would be the main reason.

      • by AmiMoJo ( 196126 )

        There are some beta BIOS updates available that fix it, but they seem to have published a bit early because someone accidentally leaked some details.

    • Wouldn't the concern be that something running on the machine could do that, whether from malware or a questionable staffer or something, and not leave a trace?
    • There's always a question of what you do once you own a machine. There's very few methods of owning a machine that have a potential to create unremovable security backdoors. Generating the same random number is one of them.

      Also to update microcode you don't need to update the bios at all. You just need to do it. A CPU can do it on the run. The earlier you do it the less likely something is to go wrong so most OSes will load the most current microcode for your CPU just before loading the system kernel. Most

    • by gweihir ( 88907 )

      Indeed. Still interesting from a research point-of-view.

    • Both AMD and Intel want to keep everybody except themselves out of the microcode, for no good reason. Or for backdoor reasons as has often been suggested. This is a jailbreak.

    • Aren't they encrypted and signed ? And not like UEFI where you can add a custom signing authority. à
      I kinda remember intel's microcode signature getting powned at some point too.

  • The random number function used to return a value between 0 and 1

  • by Tom ( 822 )

    Someone took xkcd way too literally [xkcd.com].

  • From my browsing around recently looking for info on BIOS versions, it looks like plenty of people skipped the last couple AGESA updates because the mitigations cost too much. I ran some benchmarks here and found 5% cost with AM4 AGESA Combo V2 PI 1.2.0.B vs AM4 AGESA Combo V2 PI 1.2.0.A on a 5600X. This still isn't as bad as most of the infamous Intel mitigations, and it's not affecting me in any way I've noticed so far so I may just continue to run this BIOS anyway — at least up until such a time as the performance becomes an issue for some reason that I think I can solve with only 5% more processing power.

    From what I've seen, on average mitigation is cheaper on AMD, but there's always next time. Or, perhaps, this time.

    • by gweihir ( 88907 )

      Probably nothing. This already requires local admin privileges. At that time, an attacker has won. The only thing affected may be Digital Restriction Management in the form of "secure" boot, but that does not work for the user anyways and can be safely done without.

      • I very much do not want someone who has successfully attacked my software to also be able to attack my hardware, which is what they can do if they can replace my microcode with Folger's Crystals.

  • by gweihir ( 88907 ) on Sunday February 09, 2025 @08:09PM (#65154317)

    At that time, it becomes pretty irrelevant. The attacker has won.

    Still interesting from a research perspective though, but not from a practical one.

    • by sinij ( 911942 )

      At that time, it becomes pretty irrelevant. The attacker has won.

      Still interesting from a research perspective though, but not from a practical one.

      There is still a recovery to consider (you can't re-image out of this).

      • by gweihir ( 88907 )

        There is still a recovery to consider (you can't re-image out of this).

        Anybody with root access can flash you a new BIOS. Or an old one with known vulnerabilities. Even "protected" areas in BIOS FLASH chips are not really protected.

  • You need "unpredictable for an attacker". Subtle but important difference.

    In the case at hand, "4" is random (for some definitions), but it is not unpredictable for any sane definition of unpredictable.

    • by gweihir ( 88907 )

      Why would anybody mod this down? Some people are simply insane.

      • Perhaps you have not provided a useful example outlining your supposed distinction between random and unpredictable?

  • by Ken_g6 ( 775014 ) on Monday February 10, 2025 @12:39PM (#65155969)

    <slashdotter years_ago=20>
    AMD's microcode is jailbroken! Hooray! Let a thousand custom ROMs bloom!

    Rootkit? What's that?
    </slashdotter>

    I'm not sure; it might still turn out to be useful even today.

Top Ten Things Overheard At The ANSI C Draft Committee Meetings: (4) How many times do we have to tell you, "No prior art!"

Working...