Dash:
[t2.git] / package / base / linux / 0110-give-rdrand-some-credit.patch
blobc5abf02e51a5d9d59b0a433d713beb3ec837640c
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Arjan van de Ven <arjan@linux.intel.com>
3 Date: Fri, 29 Jul 2016 19:10:52 +0000
4 Subject: [PATCH] give rdrand some credit
6 try to credit rdrand/rdseed with some entropy
8 In VMs but even modern hardware, we're super starved for entropy, and while we can
9 and do wear a tin foil hat, it's very hard to argue that
10 rdrand and rdtsc add zero entropy.
11 ---
12 drivers/char/random.c | 2 ++
13 1 file changed, 2 insertions(+)
15 diff --git a/drivers/char/random.c b/drivers/char/random.c
16 index 2a41b21623ae..d4ecc0e9aef7 100644
17 --- a/drivers/char/random.c
18 +++ b/drivers/char/random.c
19 @@ -1781,6 +1781,8 @@ static void __init init_std_data(struct entropy_store *r)
20 if (!arch_get_random_seed_long(&rv) &&
21 !arch_get_random_long(&rv))
22 rv = random_get_entropy();
23 + else
24 + credit_entropy_bits(r, 1);
25 mix_pool_bytes(r, &rv, sizeof(rv));
27 mix_pool_bytes(r, utsname(), sizeof(*(utsname())));
28 --
29 https://clearlinux.org