x86, kaslr: Mix entropy sources together as needed
authorKees Cook <keescook@chromium.org>
Mon, 11 Nov 2013 22:28:39 +0000 (14:28 -0800)
committerH. Peter Anvin <hpa@zytor.com>
Tue, 12 Nov 2013 06:29:44 +0000 (22:29 -0800)
Depending on availability, mix the RDRAND and RDTSC entropy together with
XOR. Only when neither is available should the i8254 be used. Update
the Kconfig documentation to reflect this. Additionally, since bits
used for entropy is masked elsewhere, drop the needless masking in
the get_random_long(). Similarly, use the entire TSC, not just the low
32 bits.

Finally, to improve the starting entropy, do a simple hashing of a
build-time versions string and the boot-time boot_params structure for
some additional level of unpredictability.

Signed-off-by: Kees Cook <keescook@chromium.org>
Link: http://lkml.kernel.org/r/20131111222839.GA28616@www.outflux.net
Signed-off-by: H. Peter Anvin <hpa@zytor.com>

No differences found