]> git.itanic.dy.fi Git - linux-stable/commit
x86/espfix: Use get_random_long() rather than archrandom
authorJason A. Donenfeld <Jason@zx2c4.com>
Sat, 29 Oct 2022 00:26:13 +0000 (02:26 +0200)
committerBorislav Petkov <bp@suse.de>
Mon, 31 Oct 2022 19:12:50 +0000 (20:12 +0100)
commit00ed1eabcc3b785aecf6f6cbb41d7b436bb54d28
treea9feb967f5dda767e49f42da24205667f6a85c36
parenta545b48c2d907d6096e7bcf65d9b0681cc850e69
x86/espfix: Use get_random_long() rather than archrandom

A call is made to arch_get_random_longs() and rdtsc(), rather than just
using get_random_long(), because this was written during a time when
very early boot would give abysmal entropy. These days, a call to
get_random_long() at early boot will incorporate RDRAND, RDTSC, and
more, without having to do anything bespoke.

In fact, the situation is now such that on the majority of x86 systems,
the pool actually is initialized at this point, even though it doesn't
need to be for get_random_long() to still return something better than
what this function currently does.

So simplify this to just call get_random_long() instead.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lore.kernel.org/r/20221029002613.143153-1-Jason@zx2c4.com
arch/x86/kernel/espfix_64.c