Linux 5.10 To Make One Of Its Pseudo Random Number Generators Less Predictable

Written by Michael Larabel in Linux Kernel on 12 October 2020 at 08:00 PM EDT. 2 Comments
LINUX KERNEL
The Linux kernel's prandom_u32() interface for providing pseudo-random number generation is used heavily by the kernel's networking code but that PRNG output can be figured out rather predictably. Thus lining up for Linux 5.10 is a new prandom_u32 implementation.

The prandom_u32 functionality is used in the networking code by several different drivers and for functionality like random port numbers, but since it can be trivially predicted, that isn't good.

The work led by George Spelvin in recent months re-implements prandom_u32() with a new pseudo random number generator based on the SipHash round function. Feeding the SipHash is noise from the kernel's network and scheduling activity.

With the new implementation, speed is still emphasized as critically important with the PRNG interface and obviously for those in need of more secure random number generation should look at the other RNGs. Willy Tarreau sent in the pull request changing up the random32 code and noted, "The goal is essentially to make any occasional memory leakage or brute-force attempt useless [with this new PRNG code]...The resulting code was verified to be very slightly faster on x86_64 than what is was with the controversial commit above, though this remains barely above measurement noise."
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