]> git.baikalelectronics.ru Git - kernel.git/commit
random: do not split fast init input in add_hwgenerator_randomness()
authorJan Varho <jan.varho@gmail.com>
Mon, 4 Apr 2022 16:42:30 +0000 (19:42 +0300)
committerJason A. Donenfeld <Jason@zx2c4.com>
Mon, 4 Apr 2022 17:34:49 +0000 (19:34 +0200)
commitab506e85731faea2e2af477f33c284976a7bad9c
tree813bfe6933d2159b39f3c871f0b707064363c21f
parentdbb008736a8c113ef1e12b4e4b4351fac2a15ede
random: do not split fast init input in add_hwgenerator_randomness()

add_hwgenerator_randomness() tries to only use the required amount of input
for fast init, but credits all the entropy, rather than a fraction of
it. Since it's hard to determine how much entropy is left over out of a
non-unformly random sample, either give it all to fast init or credit
it, but don't attempt to do both. In the process, we can clean up the
injection code to no longer need to return a value.

Signed-off-by: Jan Varho <jan.varho@gmail.com>
[Jason: expanded commit message]
Fixes: b122d827f679 ("random: do not throw away excess input to crng_fast_load")
Cc: stable@vger.kernel.org # 5.17+, requires 43f53ee63f10
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
drivers/char/random.c