]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - drivers/char/random.c
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)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 6 Jun 2018 15:48:41 +0000 (11:48 -0400)
commit278c2935c2adf988133f4a6e06f599a9dd9ffb77
tree347073fd1f816add1918a297aa04410fafaa7b55
parentf167b9adb576b7ac345e352d71166382327e9e7f
random: use a tighter cap in credit_entropy_bits_safe()

BugLink: http://bugs.launchpad.net/bugs/1773233
commit 9f886f4d1d292442b2f22a0a33321eae821bde40 upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Acked-by: Khalid Elmously <khalid.elmously@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/char/random.c