- Remove 'nx_warning' and 'smep_warning', which are just pointless obfuscation. - Also convert to pr_crit().
Unified · Split
| @@ -641,11 +641,6 @@ static int is_f00f_bug(struct pt_regs *regs, unsigned long address) · 640 unmodified lines | ||
| 641 | 641 | return 0; |
| 642 | 642 | } |
| 643 | 643 | |
| 644 | −static const char nx_warning[] = KERN_CRIT | |
| 645 | −"kernel tried to execute NX-protected page - exploit attempt? (uid: %d)\n"; | |
| 646 | −static const char smep_warning[] = KERN_CRIT | |
| 647 | −"unable to execute userspace code (SMEP?) (uid: %d)\n"; | |
| 648 | − | |
| 649 | 644 | static void |
| 650 | 645 | show_fault_oops(struct pt_regs *regs, unsigned long error_code, |
| 651 | 646 | unsigned long address) |
| @@ -664,11 +659,13 @@ show_fault_oops(struct pt_regs *regs, unsigned long error_code, · 12 unmodified lines | ||
| 664 | 659 | pte = lookup_address_in_pgd(pgd, address, &level); |
| 665 | 660 | |
| 666 | 661 | if (pte && pte_present(*pte) && !pte_exec(*pte)) |
| 667 | − printk(nx_warning, from_kuid(&init_user_ns, current_uid())); | |
| 662 | + pr_crit("kernel tried to execute NX-protected page - exploit attempt? (uid: %d)\n", | |
| 663 | + from_kuid(&init_user_ns, current_uid())); | |
| 668 | 664 | if (pte && pte_present(*pte) && pte_exec(*pte) && |
| 669 | 665 | (pgd_flags(*pgd) & _PAGE_USER) && |
| 670 | 666 | (__read_cr4() & X86_CR4_SMEP)) |
| 671 | − printk(smep_warning, from_kuid(&init_user_ns, current_uid())); | |
| 667 | + pr_crit("unable to execute userspace code (SMEP?) (uid: %d)\n", | |
| 668 | + from_kuid(&init_user_ns, current_uid())); | |
| 672 | 669 | } |
| 673 | 670 | |
| 674 | 671 | pr_alert("BUG: unable to handle kernel %s at %px\n", |