|
@@ -761,6 +761,7 @@ static struct timer_rand_state input_timer_state;
|
|
|
*/
|
|
|
static void add_timer_randomness(struct timer_rand_state *state, unsigned num)
|
|
|
{
|
|
|
+ struct entropy_store *r;
|
|
|
struct {
|
|
|
long jiffies;
|
|
|
unsigned cycles;
|
|
@@ -773,7 +774,8 @@ static void add_timer_randomness(struct timer_rand_state *state, unsigned num)
|
|
|
sample.jiffies = jiffies;
|
|
|
sample.cycles = random_get_entropy();
|
|
|
sample.num = num;
|
|
|
- mix_pool_bytes(&input_pool, &sample, sizeof(sample), NULL);
|
|
|
+ r = nonblocking_pool.initialized ? &input_pool : &nonblocking_pool;
|
|
|
+ mix_pool_bytes(r, &sample, sizeof(sample), NULL);
|
|
|
|
|
|
/*
|
|
|
* Calculate number of bits of randomness we probably added.
|
|
@@ -807,8 +809,7 @@ static void add_timer_randomness(struct timer_rand_state *state, unsigned num)
|
|
|
* Round down by 1 bit on general principles,
|
|
|
* and limit entropy entimate to 12 bits.
|
|
|
*/
|
|
|
- credit_entropy_bits(&input_pool,
|
|
|
- min_t(int, fls(delta>>1), 11));
|
|
|
+ credit_entropy_bits(r, min_t(int, fls(delta>>1), 11));
|
|
|
}
|
|
|
preempt_enable();
|
|
|
}
|