aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/mm/fault.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 858b47b5221b..9de4cdbf1245 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -575,6 +575,8 @@ static int is_f00f_bug(struct pt_regs *regs, unsigned long address)
575 575
576static const char nx_warning[] = KERN_CRIT 576static const char nx_warning[] = KERN_CRIT
577"kernel tried to execute NX-protected page - exploit attempt? (uid: %d)\n"; 577"kernel tried to execute NX-protected page - exploit attempt? (uid: %d)\n";
578static const char smep_warning[] = KERN_CRIT
579"unable to execute userspace code (SMEP?) (uid: %d)\n";
578 580
579static void 581static void
580show_fault_oops(struct pt_regs *regs, unsigned long error_code, 582show_fault_oops(struct pt_regs *regs, unsigned long error_code,
@@ -595,6 +597,10 @@ show_fault_oops(struct pt_regs *regs, unsigned long error_code,
595 597
596 if (pte && pte_present(*pte) && !pte_exec(*pte)) 598 if (pte && pte_present(*pte) && !pte_exec(*pte))
597 printk(nx_warning, from_kuid(&init_user_ns, current_uid())); 599 printk(nx_warning, from_kuid(&init_user_ns, current_uid()));
600 if (pte && pte_present(*pte) && pte_exec(*pte) &&
601 (pgd_flags(*pgd) & _PAGE_USER) &&
602 (read_cr4() & X86_CR4_SMEP))
603 printk(smep_warning, from_kuid(&init_user_ns, current_uid()));
598 } 604 }
599 605
600 printk(KERN_ALERT "BUG: unable to handle kernel "); 606 printk(KERN_ALERT "BUG: unable to handle kernel ");