mirror of
https://github.com/torvalds/linux.git
synced 2024-12-27 05:11:48 +00:00
f5ed777586
Make sure the machine supports RDRAND, otherwise there is no trusted source of randomness in the system. To also check this in the pre-decompression stage, make has_cpuflag() not depend on CONFIG_RANDOMIZE_BASE anymore. Signed-off-by: Martin Radev <martin.b.radev@gmail.com> Signed-off-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Borislav Petkov <bp@suse.de> Reviewed-by: Kees Cook <keescook@chromium.org> Link: https://lkml.kernel.org/r/20200907131613.12703-73-joro@8bytes.org
10 lines
146 B
C
10 lines
146 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
#include "../cpuflags.c"
|
|
|
|
bool has_cpuflag(int flag)
|
|
{
|
|
get_cpuflags();
|
|
|
|
return test_bit(flag, cpu.flags);
|
|
}
|