Spaghettifying DRAM

(github.com)

148 points | by matt_d 1 hour ago

17 comments

  • MattSteelblade 1 hour ago
    I cannot wait for the accompanying Black Hat talk. Christopher Domas is one of my absolute favorite all-time hackers. He does such a fantastic job of explaining his work. Some of my favorite talks of his:

    - Psychological Warfare in Reverse Engineering https://www.youtube.com/watch?v=HlUe0TUHOIc

    - The MoVfuscator https://www.youtube.com/watch?v=R7EEoWg6Ekk

    - Hardware Backdoors in redacted x86 https://www.youtube.com/watch?v=jmTwlEh8L7g

    • Hasz 1 hour ago
      If this is the same dude I am thinking of, his wife is also the CISO of Mozilla and do security research together, afair they have a whole book on x86 reverse engineering.

      Very cool!

    • jambalaya8 37 minutes ago
      His stuff is something else.
  • gmueckl 2 minutes ago
    OK, so this works on AMD Jaguar according to the README. That's a architecture from 2013. There's notes about Zen 3 having a different base address for the memory controller registers, but that's it. What newer CPUs does attack actually work on?
  • dooglius 9 minutes ago
    I don't understand the threat model being attacked here. If you had physical DRAM access you could do all of this anyway right? And I would assume that an unprivileged user would not have write access to the DRAM controller registers?
    • quotemstr 3 minutes ago
      Even physical DRAM access would be thwarted by transparent mandatory memory encryption, so this hack is still something else.
  • dzdt 1 hour ago
    So on an affected system, ring 0 root has access to pretty much everything that was hidden in negative ring territory. The page is pretty quiet about what other processor families might be similar beyond this specific AMD16h (an older AMD low-power family)?
    • m1el 34 minutes ago
      from the GH page: > Developed and tested on AMD Family 16h CPUs, the last generation whose datasheets document the DRAM controller's translation registers — and show that they can't be locked. 17h and beyond simply leave this information out.
    • embedding-shape 54 minutes ago
      As long as you know the controller's translation registers, it's applicable? Not tested on later one's merely because the information wasn't readily available it seems.

      > Developed and tested on AMD Family 16h CPUs, the last generation whose datasheets document the DRAM controller's translation registers — and show that they can't be locked. 17h and beyond simply leave this information out.

  • quotemstr 4 minutes ago
    This is the level of access the rightful owner of a computer should have to his own system.

    He should also be able to fuse away this access forever, to be fair. But out of the box, when I get a new laptop, I should be able to read and write every byte of DRAM.

  • devttyeu 52 minutes ago
    The big question is whether this can break out of KVM and whether it can be microrode patched / patched in any other way.

    And whether it's really real in the first place.

    • quotemstr 2 minutes ago
      This hack is 99% giving people the control over their own computers they should already have had. Guy is a Robin Hood.
    • summa_tech 41 minutes ago
      One hopes that a hypervisor would not expose hardware control registers directly in the first place, except ones deliberately designed for virtualization support.

      Otherwise, the guest is running effectively at the same privilege level as the hypervisor (that's useful sometimes, but probably not intended in most applications).

      • devttyeu 36 minutes ago
        Yeah, just started looking at this with my team (we run a cloud with VM instance offering on AMD so this very much caught our eye)

        So far seems this is about right:

        1. You need platform register access, so seems can't KVM-escape with just this

        2. Big question is what about breaking Confidential SEV-SNP guests from the host?

        • devttyeu 22 minutes ago
          Ok, on 2. and in general this exploit only works on pre-Zen AMD platforms as the repo states in not-so-clear terms.

          Zen changed DTC (DRAM Controller) to UMC (Unified Memory Controller), UMC is programmed at boot, and one would hope they figured that locking access to it makes sense when they were adding confidential compute support; Not clear though because there is no public documentation on it, so best we can hope for is some statement from AMD/3rd party researcher saying "this won't work on Zen because X/Y/Z"

  • fulafel 57 minutes ago
    Fascinating. So what is the DCT swizzling functionality designed for in the hardware originally?
    • Retr0id 36 minutes ago
      Without any swizzling, certain common access patterns can end up with subpar performance, for example walking the columns of a 2d array with a certain stride - if it ends up directing every access to the same bank on the same channel, the throughput is much lower than if the load was evenly distributed across multiple banks/channels.

      Swizzling "randomizes" bank/rank/channel distribution, which makes unlucky access patterns less likely. (Something I'd like to research is microbenchmarking different access patterns to infer the swizzle pattern and defeat physical ASLR)

  • ipdashc 29 minutes ago
    I really hate to be that guy, but man, as someone who was and is a big Christopher Domas fan (and is way dumber than him, I mean, this stuff is seriously over my head)... it's been really disappointing to see him LLM'ing all the READMEs recently. They used to be a joy to read through, but now the Claudeisms made it such a slog I could barely get through a few paragraphs. I'm glad he's using the new tools to get even more cool stuff done, but I wish he'd have gone for a human writeup at the end.
    • BugsJustFindMe 8 minutes ago
      I find vague gestures like this almost more annoying than the idea of someone using AI to write.

      > the Claudeisms

      This is hand-waving. Please be more specific.

      > made it such a slog

      On the flip-side, I didn't find it a slog at all. What if you're wrong?

      • austinthetaco 2 minutes ago
        I'm not the person you are replying to, but the readme is very clearly written by an AI, and it sounds nothing like his older work. Sometimes it's just super clear to people something is written with AI without you getting some sort of singular "gotcha" word or indicator. It's just writing patterns that would be hard to clearly establish rules for here in an HN comment, but it's incredibly obvious when you learn to spot it.
  • aecsocket 1 hour ago
    Holy shit, Christopher Domas is back. I remember watching his Defcon talks on x86 shenanigans[^1][^2] and being amazed at what he's been able to discover. Then he got whisked away by Intel and now drops this. I'm excited.

    [^1]: https://www.youtube.com/watch?v=XH0F9r0siTI

    [^2]: https://www.youtube.com/watch?v=jmTwlEh8L7g

  • Retr0id 1 hour ago
    Holy crap. This is like a software-reachable version of the dynamic memory aliasing hardware attack demonstrated by https://batteringram.eu/
  • cumshitpiss 9 minutes ago
    [dead]
  • mschuster91 1 hour ago
    [flagged]
    • russdill 44 minutes ago
      Seriously. Got tired of reading the same idea over and over reworded endlessly.
    • dcrazy 40 minutes ago
      I got suspicious but decided it wasn’t AI. The “Foo is the bar.” sentence construct is coherent with the overall “through the looking glass” tenor.
      • jchw 16 minutes ago
        Nah, it's not just that, literally all the stuff they've posted this year is obvious LLM writing, none of the stuff from previous years is. To get this close to LLM writing style without actually using an LLM, you would pretty much have to be purposefully trying.

        But I have a new favorite way of demonstrating this:

        https://github.com/search?q=owner%3Axoreaxeaxeax+load-bearin...

        Guess how many of these are from before 2025.

  • decafbad 45 minutes ago
    [flagged]
    • BugsJustFindMe 29 minutes ago
      https://en.wikipedia.org/wiki/Spaghettification - "The term was popularized by Stephen Hawking". Hawking was English.
      • nailer 15 minutes ago
        > Hawking was English.

        Odd, he had an American accent.

    • rerdavies 38 minutes ago
      Humpty Dumpty said in rather a scornful tone, “it means just what I choose it to mean—neither more nor less.” “The question is,” said Alice, “whether you can make words mean so many different things.” “The question is,” said Humpty Dumpty, “which is to be master—that's all.”

      -- Alice in Wonderland

    • ImJasonH 41 minutes ago
      nah we'll verb anything
    • fred256 41 minutes ago
      Verbing weirds language.
  • UltraSane 50 minutes ago
    Opus refuses to discuss this at all. Make of that what you will.
    • devttyeu 42 minutes ago
      Well, K3 has no problem, Sol is also fine-ish
      • HanClinto 11 minutes ago
        Likewise -- also had zero issues going over this with Sol. Seemed to give solid advice for how to test it -- use an expendable bare-metal AMD family 16h test system w/ usual standard checks that apply.

        > Run `platform_check` first and do not use `SKITTER_FORCE=1` casually. Start with the read-only `dram_state` and `dram_carveouts`, then `dram_dump --dry-run`. Avoid `dram_poke` until maps have been freshly collected and calibrated. Do not bypass fingerprint checks, calibration, fencing, or verification.

        Claude's (apparently externally-mandated?) lobotomization continues to be concerning. :-/

  • FabHK 25 minutes ago
    Could someone ELI5 please? Context, achievement, scope, consequences?