diff options
author | Peter Zijlstra <peterz@infradead.org> | 2021-05-25 10:25:20 +0300 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2021-06-01 17:00:09 +0300 |
commit | 00afe83098f59d3091a800d0db188ca495b2bc02 (patch) | |
tree | df2f4854033c45e8ed7958bdbce4a2b511586cd9 /arch/x86/mm/fault.c | |
parent | ec6aba3d2be1ed75b3f4c894bb64a36d40db1f55 (diff) | |
download | linux-00afe83098f59d3091a800d0db188ca495b2bc02.tar.xz |
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) <peterz@infradead.org>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Link: https://lore.kernel.org/r/20210525073213.660594073@infradead.org
Diffstat (limited to 'arch/x86/mm/fault.c')
-rw-r--r-- | arch/x86/mm/fault.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index 1c548ad00752..362255bfc9a8 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -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; /* |