KPTI: Report when enabled
authorKees Cook <keescook@chromium.org>
Wed, 3 Jan 2018 18:43:32 +0000 (10:43 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Jan 2018 14:44:26 +0000 (15:44 +0100)
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>
arch/x86/mm/kaiser.c

index d86d56f5e82ea72889b075bc98a5de53dca37a9d..bf6a915f60e7eb1e0a47904afc2458b978bf4829 100644 (file)
@@ -11,6 +11,9 @@
 #include <linux/uaccess.h>
 #include <linux/ftrace.h>
 
+#undef pr_fmt
+#define pr_fmt(fmt)     "Kernel/User page tables isolation: " fmt
+
 #include <asm/kaiser.h>
 #include <asm/tlbflush.h>      /* to verify its kaiser declarations */
 #include <asm/pgtable.h>
@@ -293,7 +296,7 @@ enable:
        return;
 
 disable:
-       pr_info("Kernel/User page tables isolation: disabled\n");
+       pr_info("disabled\n");
 
 silent_disable:
        kaiser_enabled = 0;
@@ -353,6 +356,8 @@ void __init kaiser_init(void)
        kaiser_add_user_map_early(&debug_idt_table,
                                  sizeof(gate_desc) * NR_VECTORS,
                                  __PAGE_KERNEL);
+
+       pr_info("enabled\n");
 }
 
 /* Add a mapping to the shadow mapping, and synchronize the mappings */