summaryrefslogtreecommitdiff
path: root/arch/x86/boot/compressed/misc.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2016-04-20 13:55:46 -0700
committerIngo Molnar <mingo@kernel.org>2016-04-22 10:00:51 +0200
commit0f8ede1b8c4cb845c53072d7e49d71ca24a61ced (patch)
tree854a42e8b983b54abe174bc9ba91da4d89334c92 /arch/x86/boot/compressed/misc.c
parentbf0118dbba9542ceb5d33d4a86830a6c88b0bbf6 (diff)
x86/KASLR: Warn when KASLR is disabled
If KASLR is built in but not available at run-time (either due to the current conflict with hibernation, command-line request, or e820 parsing failures), announce the state explicitly. To support this, a new "warn" function is created, based on the existing "error" function. Suggested-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Kees Cook <keescook@chromium.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Andrey Ryabinin <aryabinin@virtuozzo.com> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Andy Lutomirski <luto@kernel.org> Cc: Baoquan He <bhe@redhat.com> Cc: Borislav Petkov <bp@alien8.de> Cc: Borislav Petkov <bp@suse.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: Dmitry Vyukov <dvyukov@google.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: H.J. Lu <hjl.tools@gmail.com> Cc: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Yinghai Lu <yinghai@kernel.org> Link: http://lkml.kernel.org/r/1461185746-8017-6-git-send-email-keescook@chromium.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/boot/compressed/misc.c')
-rw-r--r--arch/x86/boot/compressed/misc.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
index eacc855ae08e..c57d785ff955 100644
--- a/arch/x86/boot/compressed/misc.c
+++ b/arch/x86/boot/compressed/misc.c
@@ -166,11 +166,17 @@ void __puthex(unsigned long value)
}
}
-static void error(char *x)
+void warn(char *m)
{
error_putstr("\n\n");
- error_putstr(x);
- error_putstr("\n\n -- System halted");
+ error_putstr(m);
+ error_putstr("\n\n");
+}
+
+static void error(char *m)
+{
+ warn(m);
+ error_putstr(" -- System halted");
while (1)
asm("hlt");