]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
random: make credit_entropy_bits() always safe
authorJason A. Donenfeld <Jason@zx2c4.com>
Fri, 4 Feb 2022 00:45:53 +0000 (01:45 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 25 Jun 2022 09:46:33 +0000 (11:46 +0200)
commit6605171cd8cb927fddc75cd6f4cfab50e91c5b5b
tree5d9c7cf62999f5fc65bff9c8139c13072b2a56d3
parentf82262f273f1b11d2b5a54619143ac3c1f1b7763
random: make credit_entropy_bits() always safe

commit a49c010e61e1938be851f5e49ac219d49b704103 upstream.

This is called from various hwgenerator drivers, so rather than having
one "safe" version for userspace and one "unsafe" version for the
kernel, just make everything safe; the checks are cheap and sensible to
have anyway.

Reported-by: Sultan Alsawaf <sultan@kerneltoast.com>
Reviewed-by: Eric Biggers <ebiggers@google.com>
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