diff options
-rw-r--r-- | arch/x86/mm/fault.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index 4ce62fb80da7..ebfaca3bbb12 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c | |||
@@ -595,28 +595,24 @@ static int is_f00f_bug(struct pt_regs *regs, unsigned long address) | |||
595 | return 0; | 595 | return 0; |
596 | } | 596 | } |
597 | 597 | ||
598 | static const char nx_warning[] = KERN_CRIT | ||
599 | "kernel tried to execute NX-protected page - exploit attempt? (uid: %d)\n"; | ||
600 | |||
598 | static void | 601 | static void |
599 | show_fault_oops(struct pt_regs *regs, unsigned long error_code, | 602 | show_fault_oops(struct pt_regs *regs, unsigned long error_code, |
600 | unsigned long address) | 603 | unsigned long address) |
601 | { | 604 | { |
602 | #ifdef CONFIG_X86_32 | ||
603 | if (!oops_may_print()) | 605 | if (!oops_may_print()) |
604 | return; | 606 | return; |
605 | #endif | ||
606 | 607 | ||
607 | #ifdef CONFIG_X86_PAE | ||
608 | if (error_code & PF_INSTR) { | 608 | if (error_code & PF_INSTR) { |
609 | unsigned int level; | 609 | unsigned int level; |
610 | 610 | ||
611 | pte_t *pte = lookup_address(address, &level); | 611 | pte_t *pte = lookup_address(address, &level); |
612 | 612 | ||
613 | if (pte && pte_present(*pte) && !pte_exec(*pte)) { | 613 | if (pte && pte_present(*pte) && !pte_exec(*pte)) |
614 | printk(KERN_CRIT "kernel tried to execute " | 614 | printk(nx_warning, current_uid()); |
615 | "NX-protected page - exploit attempt? " | ||
616 | "(uid: %d)\n", current_uid()); | ||
617 | } | ||
618 | } | 615 | } |
619 | #endif | ||
620 | 616 | ||
621 | printk(KERN_ALERT "BUG: unable to handle kernel "); | 617 | printk(KERN_ALERT "BUG: unable to handle kernel "); |
622 | if (address < PAGE_SIZE) | 618 | if (address < PAGE_SIZE) |