Linux To Drop "nordrand" Option - Users Should Instead Switch To "random.trust_cpu"
Jason Donenfeld of WireGuard fame continues working as well on cleaning up the Linux kernel's random/RNG code. His latest work down that rabbit hole is on removing the "nordrand" flag to instead encourage users to use the more generic "random.trust_cpu" parameter to indicate whether they trust their CPU's hardware RNG support.
Donenfeld explained in the patch currently queued in random.git:
The "nordrand" flag was added during the early days of RDRAND, when there were worries that merely using its values could compromise the RNG. However, these days, RDRAND values are not used directly but always go through the RNG's hash function, making "nordrand" no longer useful.
Rather, the correct switch is "random.trust_cpu", which not only handles the relevant trust issue directly, but also is general to multiple CPU types, not just x86.
However, x86 RDRAND does have a history of being occasionally problematic. Prior, when the kernel would notice something strange, it'd warn in dmesg and suggest enabling "nordrand". We can improve on that by making the test a little bit better and then taking the step of automatically disabling RDRAND if we detect it's problematic.
Also extend the basic sanity test to RDSEED in addition to RDRAND, and disable both if either one fails.
The improved test failure detection with RDRAND is useful as occassionally users particularly on the AMD side have reported various RDRAND issues.
The generic random.trust_cpu=0 support for indicating you don't trust your CPU's RNG was added to the kernel back in 2018.
RdRand "Bull Mountain" debuted on the Intel side a decade ago with Ivy Bridge.
Given the timing of the patch in random.git, it will presumably be sent in as part of the random changes for Linux 5.20.