Commit 318aa296 authored by Harvey Harrison's avatar Harvey Harrison Committed by Ingo Molnar

x86: more users of PF_ constants in fault_32|64.c

Should be the last of the error_code tests that could use
the PF_ defines.  Makes X86_32|64 a little closer.
Signed-off-by: default avatarHarvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent a604b380
......@@ -404,7 +404,8 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
* protection error (error_code & 9) == 0.
*/
if (unlikely(address >= TASK_SIZE)) {
if (!(error_code & 0x0000000d) && vmalloc_fault(address) >= 0)
if (!(error_code & (PF_RSVD|PF_USER|PF_PROT)) &&
vmalloc_fault(address) >= 0)
return;
if (notify_page_fault(regs))
return;
......@@ -603,7 +604,7 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
__typeof__(pte_val(__pte(0))) page;
#ifdef CONFIG_X86_PAE
if (error_code & 16) {
if (error_code & PF_INSTR) {
pte_t *pte = lookup_address(address);
if (pte && pte_present(*pte) && !pte_exec_kernel(*pte))
......@@ -674,7 +675,7 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
goto survive;
}
printk("VM: killing process %s\n", tsk->comm);
if (error_code & 4)
if (error_code & PF_USER)
do_group_exit(SIGKILL);
goto no_context;
......
......@@ -677,7 +677,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
goto again;
}
printk("VM: killing process %s\n", tsk->comm);
if (error_code & 4)
if (error_code & PF_USER)
do_group_exit(SIGKILL);
goto no_context;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment