Skip to content

Commit

Permalink
give rdrand some credit
Browse files Browse the repository at this point in the history
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 enttropy.
  • Loading branch information
fenrus75 authored and Kazuki Hashimoto committed May 1, 2021
1 parent a0cf784 commit 574189a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/char/random.c
Original file line number Diff line number Diff line change
Expand Up @@ -1768,6 +1768,8 @@ static void __init init_std_data(struct entropy_store *r)
if (!arch_get_random_seed_long(&rv) &&
!arch_get_random_long(&rv))
rv = random_get_entropy();
else
credit_entropy_bits(r, 1);
mix_pool_bytes(r, &rv, sizeof(rv));
}
mix_pool_bytes(r, utsname(), sizeof(*(utsname())));
Expand Down

0 comments on commit 574189a

Please sign in to comment.