Linux 5.10 To Make One Of Its Pseudo Random Number Generators Less Predictable
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."
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