Message ID | 20220221145816.2278732-1-Jason@zx2c4.com |
---|---|
State | New |
Headers | show |
Series | [v4] random: absorb fast pool into input pool after fast load | expand |
diff --git a/drivers/char/random.c b/drivers/char/random.c index d31b0b3afe2e..f3179c67010b 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -850,6 +850,10 @@ void add_interrupt_randomness(int irq) crng_fast_load((u8 *)fast_pool->pool, sizeof(fast_pool->pool)) > 0) { fast_pool->count = 0; fast_pool->last = now; + if (spin_trylock(&input_pool.lock)) { + _mix_pool_bytes(&fast_pool->pool, sizeof(fast_pool->pool)); + spin_unlock(&input_pool.lock); + } } return; }