random: add a config option to trust the CPU's hwrng
authorTheodore Ts'o <tytso@mit.edu>
Tue, 17 Jul 2018 22:24:27 +0000 (18:24 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 25 Jun 2022 09:46:25 +0000 (11:46 +0200)
commit923eb78099e022db51884ef80bb589a21a30dd9e
tree670570d588fa968ba7ca4db2167544e26d3390fa
parent005e7ac06d2b5e2994794efd700f5866beda4e54
random: add a config option to trust the CPU's hwrng

commit 39a8883a2b989d1d21bd8dd99f5557f0c5e89694 upstream.

This gives the user building their own kernel (or a Linux
distribution) the option of deciding whether or not to trust the CPU's
hardware random number generator (e.g., RDRAND for x86 CPU's) as being
correctly implemented and not having a back door introduced (perhaps
courtesy of a Nation State's law enforcement or intelligence
agencies).

This will prevent getrandom(2) from blocking, if there is a
willingness to trust the CPU manufacturer.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/Kconfig
drivers/char/random.c