]> git.baikalelectronics.ru Git - kernel.git/commit
random: use a tighter cap in credit_entropy_bits_safe()
authorTheodore Ts'o <tytso@mit.edu>
Sat, 25 Feb 2017 22:21:33 +0000 (18:21 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 28 Feb 2018 22:58:11 +0000 (17:58 -0500)
commit48330bde07e54e80b2efe503389b52fbead3179b
tree2ab385f9ce61d26fe0da7d64dbce2edd3990fe1c
parent0a971331c84ae05259efa3c31ed9df6504e62eb8
random: use a tighter cap in credit_entropy_bits_safe()

This fixes a harmless UBSAN where root could potentially end up
causing an overflow while bumping the entropy_total field (which is
ignored once the entropy pool has been initialized, and this generally
is completed during the boot sequence).

This is marginal for the stable kernel series, but it's a really
trivial patch, and it fixes UBSAN warning that might cause security
folks to get overly excited for no reason.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reported-by: Chen Feng <puck.chen@hisilicon.com>
Cc: stable@vger.kernel.org
drivers/char/random.c