aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/Kconfig
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2013-11-11 17:28:39 -0500
committerH. Peter Anvin <hpa@zytor.com>2013-11-12 01:29:44 -0500
commita653f3563c51c7bb7de63d607bef09d3baddaeb8 (patch)
treebb431f947a59f2301aa81e9f347dc8b531b524b4 /arch/x86/Kconfig
parentaec58bafaf89279522c44ec8ca9211eabb2b6976 (diff)
x86, kaslr: Mix entropy sources together as needed
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>
Diffstat (limited to 'arch/x86/Kconfig')
-rw-r--r--arch/x86/Kconfig14
1 files changed, 9 insertions, 5 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 51f439953d23..596cd9edeb9c 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1735,13 +1735,17 @@ config RANDOMIZE_BASE
1735 deters exploit attempts relying on knowledge of the location 1735 deters exploit attempts relying on knowledge of the location
1736 of kernel internals. 1736 of kernel internals.
1737 1737
1738 Entropy is generated using the RDRAND instruction if it 1738 Entropy is generated using the RDRAND instruction if it is
1739 is supported. If not, then RDTSC is used, if supported. If 1739 supported. If RDTSC is supported, it is used as well. If
1740 neither RDRAND nor RDTSC are supported, then no randomness 1740 neither RDRAND nor RDTSC are supported, then randomness is
1741 is introduced. 1741 read from the i8254 timer.
1742 1742
1743 The kernel will be offset by up to RANDOMIZE_BASE_MAX_OFFSET, 1743 The kernel will be offset by up to RANDOMIZE_BASE_MAX_OFFSET,
1744 and aligned according to PHYSICAL_ALIGN. 1744 and aligned according to PHYSICAL_ALIGN. Since the kernel is
1745 built using 2GiB addressing, and PHYSICAL_ALGIN must be at a
1746 minimum of 2MiB, only 10 bits of entropy is theoretically
1747 possible. At best, due to page table layouts, 64-bit can use
1748 9 bits of entropy and 32-bit uses 8 bits.
1745 1749
1746config RANDOMIZE_BASE_MAX_OFFSET 1750config RANDOMIZE_BASE_MAX_OFFSET
1747 hex "Maximum ASLR offset allowed" 1751 hex "Maximum ASLR offset allowed"