KPTI: Report when enabled
authorKees Cook <keescook@chromium.org>
Wed, 3 Jan 2018 18:18:01 +0000 (10:18 -0800)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 7 Jan 2018 01:46:54 +0000 (01:46 +0000)
Make sure dmesg reports when KPTI is enabled.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
arch/x86/mm/kaiser.c

index 8565ae2..a95acd4 100644 (file)
@@ -13,6 +13,9 @@
 #include <linux/ftrace.h>
 #include <xen/xen.h>
 
+#undef pr_fmt
+#define pr_fmt(fmt)     "Kernel/User page tables isolation: " fmt
+
 extern struct mm_struct init_mm;
 
 #include <asm/kaiser.h>
@@ -300,7 +303,7 @@ enable:
        return;
 
 disable:
-       pr_info("Kernel/User page tables isolation: disabled\n");
+       pr_info("disabled\n");
 
 silent_disable:
        kaiser_enabled = 0;
@@ -352,6 +355,8 @@ void __init kaiser_init(void)
                                  __PAGE_KERNEL_VVAR);
        kaiser_add_user_map_early((void *)VSYSCALL_START, PAGE_SIZE,
                                  vsyscall_pgprot);
+
+       pr_info("enabled\n");
 }
 
 /* Add a mapping to the shadow mapping, and synchronize the mappings */