diff options
author | Masami Hiramatsu <mhiramat@kernel.org> | 2019-02-12 11:14:09 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2019-02-13 02:16:40 -0500 |
commit | 984640ce427fa67c7c1f8550ab53495733bd11fc (patch) | |
tree | 41cc092618c53dcf2a7b9ea75de0b33f905e78c6 | |
parent | eeeb080bae906a57b6513d37efe3c38f2cb87a1c (diff) |
kprobes: Prohibit probing on preemption checking debug functions
Since kprobes depends on preempt disable/enable, probing
on the preempt debug routines can cause recursive breakpoint
bugs.
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andrea Righi <righi.andrea@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/154998804911.31052.3541963527929117920.stgit@devbox
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | lib/smp_processor_id.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/smp_processor_id.c b/lib/smp_processor_id.c index 85925aaa4fff..157d9e31f6c2 100644 --- a/lib/smp_processor_id.c +++ b/lib/smp_processor_id.c | |||
@@ -5,10 +5,11 @@ | |||
5 | * DEBUG_PREEMPT variant of smp_processor_id(). | 5 | * DEBUG_PREEMPT variant of smp_processor_id(). |
6 | */ | 6 | */ |
7 | #include <linux/export.h> | 7 | #include <linux/export.h> |
8 | #include <linux/kprobes.h> | ||
8 | #include <linux/sched.h> | 9 | #include <linux/sched.h> |
9 | 10 | ||
10 | notrace static unsigned int check_preemption_disabled(const char *what1, | 11 | notrace static nokprobe_inline |
11 | const char *what2) | 12 | unsigned int check_preemption_disabled(const char *what1, const char *what2) |
12 | { | 13 | { |
13 | int this_cpu = raw_smp_processor_id(); | 14 | int this_cpu = raw_smp_processor_id(); |
14 | 15 | ||
@@ -56,9 +57,11 @@ notrace unsigned int debug_smp_processor_id(void) | |||
56 | return check_preemption_disabled("smp_processor_id", ""); | 57 | return check_preemption_disabled("smp_processor_id", ""); |
57 | } | 58 | } |
58 | EXPORT_SYMBOL(debug_smp_processor_id); | 59 | EXPORT_SYMBOL(debug_smp_processor_id); |
60 | NOKPROBE_SYMBOL(debug_smp_processor_id); | ||
59 | 61 | ||
60 | notrace void __this_cpu_preempt_check(const char *op) | 62 | notrace void __this_cpu_preempt_check(const char *op) |
61 | { | 63 | { |
62 | check_preemption_disabled("__this_cpu_", op); | 64 | check_preemption_disabled("__this_cpu_", op); |
63 | } | 65 | } |
64 | EXPORT_SYMBOL(__this_cpu_preempt_check); | 66 | EXPORT_SYMBOL(__this_cpu_preempt_check); |
67 | NOKPROBE_SYMBOL(__this_cpu_preempt_check); | ||