diff options
Diffstat (limited to 'arch/x86/boot/compressed/aslr.c')
-rw-r--r-- | arch/x86/boot/compressed/aslr.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/x86/boot/compressed/aslr.c b/arch/x86/boot/compressed/aslr.c index 4dbf967da50d..fc6091abedb7 100644 --- a/arch/x86/boot/compressed/aslr.c +++ b/arch/x86/boot/compressed/aslr.c | |||
@@ -289,10 +289,17 @@ unsigned char *choose_kernel_location(unsigned char *input, | |||
289 | unsigned long choice = (unsigned long)output; | 289 | unsigned long choice = (unsigned long)output; |
290 | unsigned long random; | 290 | unsigned long random; |
291 | 291 | ||
292 | #ifdef CONFIG_HIBERNATION | ||
293 | if (!cmdline_find_option_bool("kaslr")) { | ||
294 | debug_putstr("KASLR disabled by default...\n"); | ||
295 | goto out; | ||
296 | } | ||
297 | #else | ||
292 | if (cmdline_find_option_bool("nokaslr")) { | 298 | if (cmdline_find_option_bool("nokaslr")) { |
293 | debug_putstr("KASLR disabled...\n"); | 299 | debug_putstr("KASLR disabled by cmdline...\n"); |
294 | goto out; | 300 | goto out; |
295 | } | 301 | } |
302 | #endif | ||
296 | 303 | ||
297 | /* Record the various known unsafe memory ranges. */ | 304 | /* Record the various known unsafe memory ranges. */ |
298 | mem_avoid_init((unsigned long)input, input_size, | 305 | mem_avoid_init((unsigned long)input, input_size, |