]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
random: credit architectural init the exact amount
authorJason A. Donenfeld <Jason@zx2c4.com>
Thu, 12 May 2022 13:32:26 +0000 (15:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 30 May 2022 07:24:07 +0000 (09:24 +0200)
commit91657c81fc3d0401189060acf54cddc201464645
treeaccce25808a6892f4278307879f51a16a370d7ea
parentd9394ac04eeb2d60518566e78835e952ed395166
random: credit architectural init the exact amount

commit 12e45a2a6308105469968951e6d563e8f4fea187 upstream.

RDRAND and RDSEED can fail sometimes, which is fine. We currently
initialize the RNG with 512 bits of RDRAND/RDSEED. We only need 256 bits
of those to succeed in order to initialize the RNG. Instead of the
current "all or nothing" approach, actually credit these contributions
the amount that is actually contributed.

Reviewed-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/random.c