History

x86/mm: Clean up the printk()s in show_fault_oops()

- Remove 'nx_warning' and 'smep_warning', which are just pointless obfuscation. - Also convert to pr_crit().

Dmitry Vyukov committed 8 years ago

Commit d79d0d81 parent b8c1e421 file · +4 −7Browse files

Unified · Split

arch/x86/mm/fault.c+4−7
@@ -641,11 +641,6 @@ static int is_f00f_bug(struct pt_regs *regs, unsigned long address) · 640 unmodified lines
641641 return 0;
642642 }
643643
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−
649644 static void
650645 show_fault_oops(struct pt_regs *regs, unsigned long error_code,
651646 unsigned long address)
@@ -664,11 +659,13 @@ show_fault_oops(struct pt_regs *regs, unsigned long error_code, · 12 unmodified lines
664659 pte = lookup_address_in_pgd(pgd, address, &level);
665660
666661 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()));
668664 if (pte && pte_present(*pte) && pte_exec(*pte) &&
669665 (pgd_flags(*pgd) & _PAGE_USER) &&
670666 (__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()));
672669 }
673670
674671 pr_alert("BUG: unable to handle kernel %s at %px\n",

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t