News for hackers. Stuff that matters.
Re:AMD: Microcode Signature Verification Vulnerability by rincebrain on Monday February 03, 2025 @02:50PM (#42922079)
"in theory" Linux, at least, was supposed to use rdrand's output as _one_ source of entropy, not _the only_ source.

No idea what Windows et al do for this, or if that's still true, but I believe the above description was how the argument was originally ended.

Also, tbh, if you can patch arbitrary instruction behavior, just replacing rdrand seems like far too ham fisted a tool with the level of versatility in your hands...

Re:AMD: Microcode Signature Verification Vulnerability by Tuna-Fish on Monday February 03, 2025 @03:10PM (#42922314)
Linux's rdrand use is proof against it returning bad output, but is not proof against malicious microcode. Reason for this is that the malicious microcode can examine register contents and alter the value it's returning so that mixing it into the previous source of randomness produces the desired evil value.
Re:AMD: Microcode Signature Verification Vulnerability by rincebrain on Monday February 03, 2025 @03:15PM (#42922398)
Sure, but as stated, if you don't trust the CPU at all, rdrand becomes the least of your concerns.
Re:AMD: Microcode Signature Verification Vulnerability by Tuna-Fish on Monday February 03, 2025 @04:18PM (#42923294)
The thing is, all the other ways you can compromise the kernel from microcode are at least theoretically detectable. A security researcher could study how the cpu operates and find the exploit. If RDRAND is surreptitiously replacing all your random numbers with AES of the current time, you cannot find that out from observing behavior.

I agree that worrying about RDRAND shouldn't probably be on the top of anyone's priorities, but there is some cause to at least use it defensively, for example using it to pre-fill buffers with random values in a different context, so that subversion would in the very least require memory references, instead of running RDRAND in the context of your RNG.

Re:AMD: Microcode Signature Verification Vulnerability by Muromec on Monday February 03, 2025 @06:13PM (#42924723)
> If RDRAND is surreptitiously replacing all your random numbers with AES of the current time, you cannot find that out from observing behavior.

Should you not see it from timing alone being wrong?

Re:AMD: Microcode Signature Verification Vulnerability by usrusr on Monday February 03, 2025 @07:11PM (#42925324)
Had the same thought. But then on the other hand, when nobody is looking at the timing, nobody will see anything. And those who do see a timing artifact, will they really dig deeper or will they just shrug off another oddity? I would not like to bet on another Clifford Stoll in this day and age.
Re:AMD: Microcode Signature Verification Vulnerability by Tuna-Fish on Tuesday February 04, 2025 @10:45AM (#42933872)
RDRAND is very slow and you can fix up the timing with a slowdown loop in the microcode.
Re:AMD: Microcode Signature Verification Vulnerability by wtallis on Monday February 03, 2025 @10:57PM (#42927707)
I think you may be overestimating the scale of attack that can be accomplished within the constraints of a microcode update. Given that the CPU has to still seem to be operating normally while using malicious microcode, how much space out of the few kilobytes of a microcode update file is really available for implementing a subtle attack, complete with monitoring the state of the larger system to detect a trigger condition or locate specific information (such as the timestamp you mention)? Sure, malicious microcode theoretically has access to basically everything, but the severely limited payload makes it a lot harder to pull off complicated attacks.
Re:AMD: Microcode Signature Verification Vulnerability by jstasiak on Monday February 03, 2025 @06:57PM (#42925180)
An article mentioning this kind of attack: https://blog.cr.yp.to/20140205-entropy.html
Re:AMD: Microcode Signature Verification Vulnerability by wahern on Monday February 03, 2025 @03:12PM (#42922335)
For organizations like the NSA, a simple hack like this is the opposite of ham-fisted, though presumably they'd try to ensure the output would pass common statistical tests. The utility in quietly breaking cryptographic protocols is presumably a major reason why it was chosen for the proof-of-concept.
Re:AMD: Microcode Signature Verification Vulnerability by rincebrain on Monday February 03, 2025 @03:16PM (#42922414)
Sure, but that was my point, was that just overriding rdrand would be much more ham-fisted than any practical attack I would expect someone to weaponize this into outside of a PoC.
Re:AMD: Microcode Signature Verification Vulnerability by dooglius on Monday February 03, 2025 @03:12PM (#42922349)
Intel's theory I believe was that it could become the only source. The argument in favor I think is the same one you are making now: anything that could hack the chip deeply enough to break rdrand is powerful enough to achieve the same goals in another way.
Re:AMD: Microcode Signature Verification Vulnerability by rincebrain on Monday February 03, 2025 @03:22PM (#42922493)
I'm sure Intel loved that idea, given that I don't think RDRAND showed up on AMD chips for 3 years after Intel launched support for it, and that would let them look much better on a number of benchmarks for that duration...
Re:AMD: Microcode Signature Verification Vulnerability by formerly_proven on Monday February 03, 2025 @05:15PM (#42924031)
I think you misunderstand where in the pipeline RDRAND would sit. It's not a high-performance RNG, that instruction takes hundreds of cycles and generates a couple bytes of data. It's used to derive keys for the actual CSPRNG providing e.g. /dev/urandom (which is basically a stream cipher). Having or not having RDRAND would have no performance impact on the CSPRNG.
Re:AMD: Microcode Signature Verification Vulnerability by rincebrain on Sunday February 09, 2025 @03:38PM (#42993701)
Sure, but as I recall, in those days, the system would happily block for a bit if you managed to drain the estimated entropy pool low enough by doing something like generating an openssh key on first boot, so having another source that the competition takes 3 years to implement could have provided noticable performance benefits for things people notice, like how slow first boot is, in the days before zx2c4 looked at Linux's /dev/random code and hit it with hammers.

(I'm not insisting on that workflow or example being an uptick, just that that's a concrete example of how having an additional source back then could have caused noticable performance differences. I'm aware you're not calling rdrand for your /dev/urandom or random accesses, now or then.)

Re:AMD: Microcode Signature Verification Vulnerability by dist-epoch on Monday February 03, 2025 @04:06PM (#42923127)
Windows collects hardware device entropy and mixes it into the pool.

It also persists the pool across reboots so it doesn't start empty.