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

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."
2 Comments