random: clamp credited irq bits to maximum mixed
authorJason A. Donenfeld <Jason@zx2c4.com>
Fri, 23 Sep 2022 00:42:51 +0000 (02:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 15 Oct 2022 05:59:01 +0000 (07:59 +0200)
commit14f143fb42685bcc4400f6ef5c76f5e09b79193a
tree353b7ef8c6ac45cd74dca7a55e14ecb256d332a8
parentbe53fa6cf667b9aac5ad64ba209ac9e14c610dee
random: clamp credited irq bits to maximum mixed

commit e78a802a7b4febf53f2a92842f494b01062d85a8 upstream.

Since the most that's mixed into the pool is sizeof(long)*2, don't
credit more than that many bytes of entropy.

Fixes: e3e33fc2ea7f ("random: do not use input pool from hard IRQs")
Cc: stable@vger.kernel.org
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/random.c