Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86, rdrand: When nordrand is specified, disable RDSEED as well

One can logically expect that when the user has specified "nordrand",
the user doesn't want any use of the CPU random number generator,
neither RDRAND nor RDSEED, so disable both.

Reported-by: Stephan Mueller <smueller@chronox.de>
Cc: Theodore Ts'o <tytso@mit.edu>
Link: http://lkml.kernel.org/r/21542339.0lFnPSyGRS@myon.chronox.de
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>

+5 -4
+4 -4
Documentation/kernel-parameters.txt
··· 2218 2218 noreplace-smp [X86-32,SMP] Don't replace SMP instructions 2219 2219 with UP alternatives 2220 2220 2221 - nordrand [X86] Disable the direct use of the RDRAND 2222 - instruction even if it is supported by the 2223 - processor. RDRAND is still available to user 2224 - space applications. 2221 + nordrand [X86] Disable kernel use of the RDRAND and 2222 + RDSEED instructions even if they are supported 2223 + by the processor. RDRAND and RDSEED are still 2224 + available to user space applications. 2225 2225 2226 2226 noresume [SWSUSP] Disables resume and restores original swap 2227 2227 space.
+1
arch/x86/kernel/cpu/rdrand.c
··· 27 27 static int __init x86_rdrand_setup(char *s) 28 28 { 29 29 setup_clear_cpu_cap(X86_FEATURE_RDRAND); 30 + setup_clear_cpu_cap(X86_FEATURE_RDSEED); 30 31 return 1; 31 32 } 32 33 __setup("nordrand", x86_rdrand_setup);