]> git.baikalelectronics.ru Git - kernel.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)
committerJason A. Donenfeld <Jason@zx2c4.com>
Mon, 21 Feb 2022 15:48:06 +0000 (16:48 +0100)
commite2da215d7fca5ef81843ad612d93865049b2ae7e
treee6e21870540911035caa454ceea1036ce26e1402
parent3759d99ad2a8f7ccda0385d5c29749928976f47d
random: make credit_entropy_bits() always safe

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>
drivers/char/random.c