Skip to content

Commit

Permalink
KPTI: Report when enabled
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kees Cook authored and Greg Kroah-Hartman committed Jan 5, 2018
1 parent 3e1457d commit bfd51a4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion arch/x86/mm/kaiser.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -293,7 +296,7 @@ void __init kaiser_check_boottime_disable(void)
return;

disable:
pr_info("Kernel/User page tables isolation: disabled\n");
pr_info("disabled\n");

silent_disable:
kaiser_enabled = 0;
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit bfd51a4

Please sign in to comment.