]> git.baikalelectronics.ru Git - kernel.git/commit
random: always fill buffer in get_random_bytes_wait
authorJason A. Donenfeld <Jason@zx2c4.com>
Sun, 4 Feb 2018 22:07:46 +0000 (23:07 +0100)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 28 Feb 2018 22:59:21 +0000 (17:59 -0500)
commit09d6af95cea2454ad66f7e1a6b854d4725a64830
tree18b2960df3683d779c53b8f591463091eae30f19
parent48330bde07e54e80b2efe503389b52fbead3179b
random: always fill buffer in get_random_bytes_wait

In the unfortunate event that a developer fails to check the return
value of get_random_bytes_wait, or simply wants to make a "best effort"
attempt, for whatever that's worth, it's much better to still fill the
buffer with _something_ rather than catastrophically failing in the case
of an interruption. This is both a defense in depth measure against
inevitable programming bugs, as well as a means of making the API a bit
more useful.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
include/linux/random.h