x86/KASLR, x86/power: Remove x86 hibernation restrictions
authorKees Cook <keescook@chromium.org>
Mon, 13 Jun 2016 22:10:02 +0000 (15:10 -0700)
committerIngo Molnar <mingo@kernel.org>
Sun, 26 Jun 2016 10:32:03 +0000 (12:32 +0200)
With the following fix:

  70595b479ce1 ("x86/power/64: Fix crash whan the hibernation code passes control to the image kernel")

... there is no longer a problem with hibernation resuming a
KASLR-booted kernel image, so remove the restriction.

Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Baoquan He <bhe@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Len Brown <len.brown@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Linux PM list <linux-pm@vger.kernel.org>
Cc: Logan Gunthorpe <logang@deltatee.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: linux-doc@vger.kernel.org
Link: http://lkml.kernel.org/r/20160613221002.GA29719@www.outflux.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Documentation/kernel-parameters.txt
arch/x86/boot/compressed/kaslr.c
kernel/power/hibernate.c

index 82b42c9..fa8c6d4 100644 (file)
@@ -1803,12 +1803,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
        js=             [HW,JOY] Analog joystick
                        See Documentation/input/joystick.txt.
 
-       kaslr/nokaslr   [X86]
-                       Enable/disable kernel and module base offset ASLR
-                       (Address Space Layout Randomization) if built into
-                       the kernel. When CONFIG_HIBERNATION is selected,
-                       kASLR is disabled by default. When kASLR is enabled,
-                       hibernation will be disabled.
+       nokaslr         [KNL]
+                       When CONFIG_RANDOMIZE_BASE is set, this disables
+                       kernel and module base offset ASLR (Address Space
+                       Layout Randomization).
 
        keepinitrd      [HW,ARM]
 
index cfeb025..dff4217 100644 (file)
@@ -471,17 +471,10 @@ unsigned char *choose_random_location(unsigned long input,
        unsigned long choice = output;
        unsigned long random_addr;
 
-#ifdef CONFIG_HIBERNATION
-       if (!cmdline_find_option_bool("kaslr")) {
-               warn("KASLR disabled: 'kaslr' not on cmdline (hibernation selected).");
-               goto out;
-       }
-#else
        if (cmdline_find_option_bool("nokaslr")) {
                warn("KASLR disabled: 'nokaslr' on cmdline.");
                goto out;
        }
-#endif
 
        boot_params->hdr.loadflags |= KASLR_FLAG;
 
index fca9254..9021387 100644 (file)
@@ -1154,11 +1154,6 @@ static int __init nohibernate_setup(char *str)
        return 1;
 }
 
-static int __init kaslr_nohibernate_setup(char *str)
-{
-       return nohibernate_setup(str);
-}
-
 static int __init page_poison_nohibernate_setup(char *str)
 {
 #ifdef CONFIG_PAGE_POISONING_ZERO
@@ -1182,5 +1177,4 @@ __setup("hibernate=", hibernate_setup);
 __setup("resumewait", resumewait_setup);
 __setup("resumedelay=", resumedelay_setup);
 __setup("nohibernate", nohibernate_setup);
-__setup("kaslr", kaslr_nohibernate_setup);
 __setup("page_poison=", page_poison_nohibernate_setup);