mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
x86,kprobes: WARN if kprobes tries to handle a fault
With the removal of kprobe::handle_fault there is no reason left that kprobe_page_fault() would ever return true on x86, make sure it doesn't happen by accident. Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Acked-by: Masami Hiramatsu <[email protected]> Link: https://lore.kernel.org/r/[email protected]
This commit is contained in:
1 parent
ec6aba3d2b
commit
00afe83098
1 file changed
+2
-2
+2
-2
@@ -1186,7 +1186,7 @@ do_kern_addr_fault(struct pt_regs *regs, unsigned long hw_error_code,
|
||||
return;
|
||||
|
||||
/* kprobes don't want to hook the spurious faults: */
|
||||
if (kprobe_page_fault(regs, X86_TRAP_PF))
|
||||
if (WARN_ON_ONCE(kprobe_page_fault(regs, X86_TRAP_PF)))
|
||||
return;
|
||||
|
||||
/*
|
||||
@@ -1239,7 +1239,7 @@ void do_user_addr_fault(struct pt_regs *regs,
|
||||
}
|
||||
|
||||
/* kprobes don't want to hook the spurious faults: */
|
||||
if (unlikely(kprobe_page_fault(regs, X86_TRAP_PF)))
|
||||
if (WARN_ON_ONCE(kprobe_page_fault(regs, X86_TRAP_PF)))
|
||||
return;
|
||||
|
||||
/*
|
||||
|
||||
Reference in new issue
Block a user