News for hackers. Stuff that matters.
Re:RDRAND on AMD Ryzen 9 5900X is flakey by lrossi on Monday January 11, 2021 @05:47PM (#25738786)
Some questions that come to mind:

1. Why does systemd implement its own random number generation code?

https://github.com/systemd/systemd/blob/27231dc14c925935b669...

2. systemd uses RDRAND to generate UUIDs only. Why isn’t the algorithm robust to collisions?

https://github.com/systemd/systemd/issues/18184#issuecomment...

3. Why do you have to pass systemd args on the kernel command line?

https://github.com/systemd/systemd/issues/18184#issuecomment...

4. This is not the first time this happens. Why weren’t they able to provide a solution in 2 years?

https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/18358...

Re:RDRAND on AMD Ryzen 9 5900X is flakey by chmod775 on Monday January 11, 2021 @05:54PM (#25738948)
1. That's not random number generation code, that's code that uses random number generators.

2. What algorithm? It's just RDRAND.

3. Where else would you pass them?

4. What do you mean 'they'? CPU manufacturers?

You might also be interested in this comment: https://github.com/systemd/systemd/blob/bcac754d66374782a85a...

Re:RDRAND on AMD Ryzen 9 5900X is flakey by lrossi on Monday January 11, 2021 @06:01PM (#25739108)
Not sure if you followed the links I posted, but as Poettering said, the problem is that there are collisions in UUIDs. UUID generation should be robust to random number collisions.
Re:RDRAND on AMD Ryzen 9 5900X is flakey by chmod775 on Monday January 11, 2021 @06:14PM (#25739369)
So you actually want them to wrap RDRAND in their own random number generator?

> UUID generation should be robust to random number collisions.

The UUID standards say that nowhere at all, it is only acknowledged that collisions may happen even if they are unlikely.

Re:RDRAND on AMD Ryzen 9 5900X is flakey by citrin_ru on Monday January 11, 2021 @07:54PM (#25740771)
Purpose of UUID is to be unique, not random. There is no need to wrap RDRAND into another random generator. One can use time/counter as one part of UUID and kernel provided PRNG, e. g. getrandom(2) for another part.
Re:RDRAND on AMD Ryzen 9 5900X is flakey by segfaultbuserr on Monday January 11, 2021 @08:15PM (#25740972)
> getrandom(2) for another part.

But you cannot use getrandom().

During early boot, the kernel will either block indefinitely and/or log the uninitialized urandom read as a security problem. It was the entire reason that brought systemd's rdrand code into existence.

Re:RDRAND on AMD Ryzen 9 5900X is flakey by LukeShu on Monday January 11, 2021 @06:15PM (#25739399)
1. Scroll up in the same file, there's a lengthy comment about it.

3. You don't. The `nordrand` argument is a kernel argument that tells the kernel to disable rdrand; so then when systemd asks the kernel if rdrand is supported the kernel says "no". The `SYSTEMD_RDRAND=0` argument is indeed a systemd argument, but it's absolutely normal to pass init arguments on the kernel command line.

4. Because hacking around hardware bugs isn't systemd's job. It's the kernel's. You shouldn't be filing a systemd bug, you should be filing a Linux bug to disable rdrand on that cpuid. Why aren't you asking why Linux wasn't able to provide a solution in 2 years?