diff options
author | Will Deacon <[email protected]> | 2021-02-12 15:11:11 +0000 |
---|---|---|
committer | Will Deacon <[email protected]> | 2021-02-12 15:11:11 +0000 |
commit | cf6a85a85089f2a7750a5eef6f4dd4721b1c441c (patch) | |
tree | 105d85104e1b9e7b64e6628bed82c52f4fc14979 | |
parent | c974a8e574f9644aba0607958a3abce596699dc1 (diff) | |
parent | 390596c9959c2a4f5b456df339f0604df3d55fe0 (diff) |
Merge branch 'for-next/random' into for-next/core
Avoid calling arch_get_random_seed_long() from add_interrupt_randomness()
as this can result in a firmware call on some arm64 systems.
* for-next/random:
random: avoid arch_get_random_seed_long() when collecting IRQ randomness
-rw-r--r-- | drivers/char/random.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/drivers/char/random.c b/drivers/char/random.c index 5f3b8ac9d97b..84e24986a97a 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -1261,8 +1261,6 @@ void add_interrupt_randomness(int irq, int irq_flags) cycles_t cycles = random_get_entropy(); __u32 c_high, j_high; __u64 ip; - unsigned long seed; - int credit = 0; if (cycles == 0) cycles = get_reg(fast_pool, regs); @@ -1298,23 +1296,12 @@ void add_interrupt_randomness(int irq, int irq_flags) fast_pool->last = now; __mix_pool_bytes(r, &fast_pool->pool, sizeof(fast_pool->pool)); - - /* - * If we have architectural seed generator, produce a seed and - * add it to the pool. For the sake of paranoia don't let the - * architectural seed generator dominate the input from the - * interrupt noise. - */ - if (arch_get_random_seed_long(&seed)) { - __mix_pool_bytes(r, &seed, sizeof(seed)); - credit = 1; - } spin_unlock(&r->lock); fast_pool->count = 0; /* award one bit for the contents of the fast pool */ - credit_entropy_bits(r, credit + 1); + credit_entropy_bits(r, 1); } EXPORT_SYMBOL_GPL(add_interrupt_randomness); |