]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - arch/x86/Kconfig
Merge branch 'x86-boot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[mirror_ubuntu-artful-kernel.git] / arch / x86 / Kconfig
index df884a522c396527ba76aeca4781ba3b0c10557c..51b028c1ca96402fd95a6ca9dcaddd0b99b94eda 100644 (file)
@@ -1929,21 +1929,26 @@ config RANDOMIZE_BASE
          attempts relying on knowledge of the location of kernel
          code internals.
 
-         The kernel physical and virtual address can be randomized
-         from 16MB up to 1GB on 64-bit and 512MB on 32-bit. (Note that
-         using RANDOMIZE_BASE reduces the memory space available to
-         kernel modules from 1.5GB to 1GB.)
+         On 64-bit, the kernel physical and virtual addresses are
+         randomized separately. The physical address will be anywhere
+         between 16MB and the top of physical memory (up to 64TB). The
+         virtual address will be randomized from 16MB up to 1GB (9 bits
+         of entropy). Note that this also reduces the memory space
+         available to kernel modules from 1.5GB to 1GB.
+
+         On 32-bit, the kernel physical and virtual addresses are
+         randomized together. They will be randomized from 16MB up to
+         512MB (8 bits of entropy).
 
          Entropy is generated using the RDRAND instruction if it is
          supported. If RDTSC is supported, its value is mixed into
          the entropy pool as well. If neither RDRAND nor RDTSC are
-         supported, then entropy is read from the i8254 timer.
-
-         Since the kernel is built using 2GB addressing, and
-         PHYSICAL_ALIGN must be at a minimum of 2MB, only 10 bits of
-         entropy is theoretically possible. Currently, with the
-         default value for PHYSICAL_ALIGN and due to page table
-         layouts, 64-bit uses 9 bits of entropy and 32-bit uses 8 bits.
+         supported, then entropy is read from the i8254 timer. The
+         usable entropy is limited by the kernel being built using
+         2GB addressing, and that PHYSICAL_ALIGN must be at a
+         minimum of 2MB. As a result, only 10 bits of entropy are
+         theoretically possible, but the implementations are further
+         limited due to memory layouts.
 
          If CONFIG_HIBERNATE is also enabled, KASLR is disabled at boot
          time. To enable it, boot with "kaslr" on the kernel command
@@ -1983,6 +1988,38 @@ config PHYSICAL_ALIGN
 
          Don't change this unless you know what you are doing.
 
+config RANDOMIZE_MEMORY
+       bool "Randomize the kernel memory sections"
+       depends on X86_64
+       depends on RANDOMIZE_BASE
+       default RANDOMIZE_BASE
+       ---help---
+          Randomizes the base virtual address of kernel memory sections
+          (physical memory mapping, vmalloc & vmemmap). This security feature
+          makes exploits relying on predictable memory locations less reliable.
+
+          The order of allocations remains unchanged. Entropy is generated in
+          the same way as RANDOMIZE_BASE. Current implementation in the optimal
+          configuration have in average 30,000 different possible virtual
+          addresses for each memory section.
+
+          If unsure, say N.
+
+config RANDOMIZE_MEMORY_PHYSICAL_PADDING
+       hex "Physical memory mapping padding" if EXPERT
+       depends on RANDOMIZE_MEMORY
+       default "0xa" if MEMORY_HOTPLUG
+       default "0x0"
+       range 0x1 0x40 if MEMORY_HOTPLUG
+       range 0x0 0x40
+       ---help---
+          Define the padding in terabytes added to the existing physical
+          memory size during kernel memory randomization. It is useful
+          for memory hotplug support but reduces the entropy available for
+          address randomization.
+
+          If unsure, leave at the default value.
+
 config HOTPLUG_CPU
        bool "Support for hot-pluggable CPUs"
        depends on SMP