From 43b33de115d890f123bb58061e646611934c0978 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Wed, 3 Jan 2018 10:43:32 -0800 Subject: [PATCH] KPTI: Report when enabled Make sure dmesg reports when KPTI is enabled. Signed-off-by: Kees Cook Signed-off-by: Greg Kroah-Hartman (cherry picked from commit bfd51a4d715b6ef44bd01b9fbfc13da936f93d76) Orabug: 27333760 CVE: CVE-2017-5754 Signed-off-by: Pavel Tatashin Conflicts: arch/x86/mm/kaiser.c Signed-off-by: Kirtikar Kashyap --- arch/x86/mm/kaiser.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/x86/mm/kaiser.c b/arch/x86/mm/kaiser.c index 50783ad4861d..f77dbc99fefc 100644 --- a/arch/x86/mm/kaiser.c +++ b/arch/x86/mm/kaiser.c @@ -11,6 +11,9 @@ #include #include +#undef pr_fmt +#define pr_fmt(fmt) "Kernel/User page tables isolation: " fmt + #include #include /* to verify its kaiser declarations */ #include @@ -290,7 +293,7 @@ enable: return; disable: - pr_info("Kernel/User page tables isolation: disabled\n"); + pr_info("disabled\n"); kaiser_enabled = 0; setup_clear_cpu_cap(X86_FEATURE_KAISER); } @@ -348,6 +351,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 */ -- 2.50.1