diff options
-rw-r--r-- | arch/x86_64/mm/fault.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/x86_64/mm/fault.c b/arch/x86_64/mm/fault.c index 21d1596946d6..fd07b86c062d 100644 --- a/arch/x86_64/mm/fault.c +++ b/arch/x86_64/mm/fault.c | |||
@@ -299,7 +299,8 @@ int exception_trace = 1; | |||
299 | * bit 0 == 0 means no page found, 1 means protection fault | 299 | * bit 0 == 0 means no page found, 1 means protection fault |
300 | * bit 1 == 0 means read, 1 means write | 300 | * bit 1 == 0 means read, 1 means write |
301 | * bit 2 == 0 means kernel, 1 means user-mode | 301 | * bit 2 == 0 means kernel, 1 means user-mode |
302 | * bit 3 == 1 means fault was an instruction fetch | 302 | * bit 3 == 1 means use of reserved bit detected |
303 | * bit 4 == 1 means fault was an instruction fetch | ||
303 | */ | 304 | */ |
304 | asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, | 305 | asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, |
305 | unsigned long error_code) | 306 | unsigned long error_code) |
@@ -342,10 +343,10 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, | |||
342 | * | 343 | * |
343 | * This verifies that the fault happens in kernel space | 344 | * This verifies that the fault happens in kernel space |
344 | * (error_code & 4) == 0, and that the fault was not a | 345 | * (error_code & 4) == 0, and that the fault was not a |
345 | * protection error (error_code & 1) == 0. | 346 | * protection error (error_code & 9) == 0. |
346 | */ | 347 | */ |
347 | if (unlikely(address >= TASK_SIZE64)) { | 348 | if (unlikely(address >= TASK_SIZE64)) { |
348 | if (!(error_code & 5) && | 349 | if (!(error_code & 0xd) && |
349 | ((address >= VMALLOC_START && address < VMALLOC_END) || | 350 | ((address >= VMALLOC_START && address < VMALLOC_END) || |
350 | (address >= MODULES_VADDR && address < MODULES_END))) { | 351 | (address >= MODULES_VADDR && address < MODULES_END))) { |
351 | if (vmalloc_fault(address) < 0) | 352 | if (vmalloc_fault(address) < 0) |