mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 22:54:01 +00:00
random: clamp credited irq bits to maximum mixed
commite78a802a7b
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:e3e33fc2ea
("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>
This commit is contained in:
parent
e1f8820bf8
commit
b42a64428a
1 changed files with 1 additions and 1 deletions
|
@ -989,7 +989,7 @@ static void mix_interrupt_randomness(struct work_struct *work)
|
|||
local_irq_enable();
|
||||
|
||||
mix_pool_bytes(pool, sizeof(pool));
|
||||
credit_init_bits(max(1u, (count & U16_MAX) / 64));
|
||||
credit_init_bits(clamp_t(unsigned int, (count & U16_MAX) / 64, 1, sizeof(pool) * 8));
|
||||
|
||||
memzero_explicit(pool, sizeof(pool));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue