]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
random: check for crng_init == 0 in add_device_randomness()
authorJason A. Donenfeld <Jason@zx2c4.com>
Sat, 12 Feb 2022 22:57:38 +0000 (23:57 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 25 Jun 2022 09:46:35 +0000 (11:46 +0200)
commit5357d828bc6abb235121c022fdf3f21e2fb3f12e
tree19362e5007a8bfe7631820047ad7ae3f9325aa3d
parent535d280612b5af4ed7fade95cc9818d7e30b1083
random: check for crng_init == 0 in add_device_randomness()

commit 1daf2f387652bf3a7044aea042f5023b3f6b189b upstream.

This has no real functional change, as crng_pre_init_inject() (and
before that, crng_slow_init()) always checks for == 0, not >= 2. So
correct the outer unlocked change to reflect that. Before this used
crng_ready(), which was not correct.

Cc: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Dominik Brodowski <linux@dominikbrodowski.net>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/random.c