diff options
| author | Masami Hiramatsu <[email protected]> | 2019-09-03 20:08:21 +0900 |
|---|---|---|
| committer | Ingo Molnar <[email protected]> | 2019-09-05 10:15:16 +0200 |
| commit | e336b4027775cb458dc713745e526fa1a1996b2a (patch) | |
| tree | 5a73f34085d6b815f28ab175c79323f4c187dc77 /include/linux | |
| parent | d9f3b450f206332b7ef3d78b5a85b6c20ad00fd2 (diff) | |
kprobes: Prohibit probing on BUG() and WARN() address
Since BUG() and WARN() may use a trap (e.g. UD2 on x86) to
get the address where the BUG() has occurred, kprobes can not
do single-step out-of-line that instruction. So prohibit
probing on such address.
Without this fix, if someone put a kprobe on WARN(), the
kernel will crash with invalid opcode error instead of
outputing warning message, because kernel can not find
correct bug address.
Signed-off-by: Masami Hiramatsu <[email protected]>
Acked-by: Steven Rostedt (VMware) <[email protected]>
Acked-by: Naveen N. Rao <[email protected]>
Cc: Anil S Keshavamurthy <[email protected]>
Cc: David S . Miller <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Naveen N . Rao <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Link: https://lkml.kernel.org/r/156750890133.19112.3393666300746167111.stgit@devnote2
Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/bug.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/bug.h b/include/linux/bug.h index fe5916550da8..f639bd0122f3 100644 --- a/include/linux/bug.h +++ b/include/linux/bug.h @@ -47,6 +47,11 @@ void generic_bug_clear_once(void); #else /* !CONFIG_GENERIC_BUG */ +static inline void *find_bug(unsigned long bugaddr) +{ + return NULL; +} + static inline enum bug_trap_type report_bug(unsigned long bug_addr, struct pt_regs *regs) { |