diff options
Diffstat (limited to 'arch/x86/mm/fault.c')
| -rw-r--r-- | arch/x86/mm/fault.c | 23 | 
1 files changed, 7 insertions, 16 deletions
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index 9a84a0d08727..db1c042e9853 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -317,8 +317,6 @@ static noinline int vmalloc_fault(unsigned long address)  	if (!(address >= VMALLOC_START && address < VMALLOC_END))  		return -1; -	WARN_ON_ONCE(in_nmi()); -  	/*  	 * Synchronize this task's top level page-table  	 * with the 'reference' page table. @@ -641,11 +639,6 @@ static int is_f00f_bug(struct pt_regs *regs, unsigned long address)  	return 0;  } -static const char nx_warning[] = KERN_CRIT -"kernel tried to execute NX-protected page - exploit attempt? (uid: %d)\n"; -static const char smep_warning[] = KERN_CRIT -"unable to execute userspace code (SMEP?) (uid: %d)\n"; -  static void  show_fault_oops(struct pt_regs *regs, unsigned long error_code,  		unsigned long address) @@ -664,20 +657,18 @@ show_fault_oops(struct pt_regs *regs, unsigned long error_code,  		pte = lookup_address_in_pgd(pgd, address, &level);  		if (pte && pte_present(*pte) && !pte_exec(*pte)) -			printk(nx_warning, from_kuid(&init_user_ns, current_uid())); +			pr_crit("kernel tried to execute NX-protected page - exploit attempt? (uid: %d)\n", +				from_kuid(&init_user_ns, current_uid()));  		if (pte && pte_present(*pte) && pte_exec(*pte) &&  				(pgd_flags(*pgd) & _PAGE_USER) &&  				(__read_cr4() & X86_CR4_SMEP)) -			printk(smep_warning, from_kuid(&init_user_ns, current_uid())); +			pr_crit("unable to execute userspace code (SMEP?) (uid: %d)\n", +				from_kuid(&init_user_ns, current_uid()));  	} -	printk(KERN_ALERT "BUG: unable to handle kernel "); -	if (address < PAGE_SIZE) -		printk(KERN_CONT "NULL pointer dereference"); -	else -		printk(KERN_CONT "paging request"); - -	printk(KERN_CONT " at %px\n", (void *) address); +	pr_alert("BUG: unable to handle kernel %s at %px\n", +		 address < PAGE_SIZE ? "NULL pointer dereference" : "paging request", +		 (void *)address);  	dump_pagetable(address);  }  | 
