Linux To Drop "nordrand" Option - Users Should Instead Switch To "random.trust_cpu"

Written by Michael Larabel in Linux Security on 10 July 2022 at 05:55 AM EDT. 6 Comments
LINUX SECURITY
The Linux kernel has long honored the "nordrand" kernel parameter to disable kernel use of the Intel RDRAND and RDSEED instructions if not trusting them -- either out of security concerns that they could be compromised by the vendor or running into hardware/firmware issues around RdRand usage. But the Linux kernel is preparing to drop that kernel parameter with users encouraged to use the more generic "random.trust_cpu" parameter.

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.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week