~xdavidwu/linux-xdavidwu-xps

ref: d26c9037c2817a9cce12e8e9d1a832aab2c7bcf5 linux-xdavidwu-xps/0110-give-rdrand-some-credit.patch -rw-r--r-- 967 bytes
d26c9037Pinghao Wu Auto Update: 6.12.5 -> 6.12.6 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <arjan@linux.intel.com>
Date: Fri, 29 Jul 2016 19:10:52 +0000
Subject: [PATCH] give rdrand some credit

try to credit rdrand/rdseed with some entropy

In VMs but even modern hardware, we're super starved for entropy, and while we can
and do wear a tin foil hat, it's very hard to argue that
rdrand and rdtsc add zero entropy.
---
 drivers/char/random.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/char/random.c b/drivers/char/random.c
index 3404a91edf29..479994faedba 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1678,6 +1678,8 @@ static void __init init_std_data(void)
 		if (!arch_get_random_seed_long(&rv) &&
 		    !arch_get_random_long(&rv))
 			rv = random_get_entropy();
+		else
+			credit_entropy_bits(1);
 		mix_pool_bytes(&rv, sizeof(rv));
 	}
 	mix_pool_bytes(utsname(), sizeof(*(utsname())));
-- 
https://clearlinux.org