diff options
| author | Masami Hiramatsu <mhiramat@kernel.org> | 2019-02-12 11:13:40 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2019-02-13 02:16:40 -0500 |
| commit | eeeb080bae906a57b6513d37efe3c38f2cb87a1c (patch) | |
| tree | 481d11a8b3e5095d8490046bd95a3522ab1dcbe1 /kernel/trace/trace_irqsoff.c | |
| parent | 6143c6fb1e8f9bde9c434038f7548a19d36b55e7 (diff) | |
kprobes: Prohibit probing on hardirq tracers
Since kprobes breakpoint handling involves hardirq tracer,
probing these functions cause breakpoint recursion problem.
Prohibit probing on those functions.
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.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: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/154998802073.31052.17255044712514564153.stgit@devbox
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/trace/trace_irqsoff.c')
| -rw-r--r-- | kernel/trace/trace_irqsoff.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/kernel/trace/trace_irqsoff.c b/kernel/trace/trace_irqsoff.c index d3294721f119..d42a473b8240 100644 --- a/kernel/trace/trace_irqsoff.c +++ b/kernel/trace/trace_irqsoff.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <linux/uaccess.h> | 14 | #include <linux/uaccess.h> |
| 15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
| 16 | #include <linux/ftrace.h> | 16 | #include <linux/ftrace.h> |
| 17 | #include <linux/kprobes.h> | ||
| 17 | 18 | ||
| 18 | #include "trace.h" | 19 | #include "trace.h" |
| 19 | 20 | ||
| @@ -365,7 +366,7 @@ out: | |||
| 365 | __trace_function(tr, CALLER_ADDR0, parent_ip, flags, pc); | 366 | __trace_function(tr, CALLER_ADDR0, parent_ip, flags, pc); |
| 366 | } | 367 | } |
| 367 | 368 | ||
| 368 | static inline void | 369 | static nokprobe_inline void |
| 369 | start_critical_timing(unsigned long ip, unsigned long parent_ip, int pc) | 370 | start_critical_timing(unsigned long ip, unsigned long parent_ip, int pc) |
| 370 | { | 371 | { |
| 371 | int cpu; | 372 | int cpu; |
| @@ -401,7 +402,7 @@ start_critical_timing(unsigned long ip, unsigned long parent_ip, int pc) | |||
| 401 | atomic_dec(&data->disabled); | 402 | atomic_dec(&data->disabled); |
| 402 | } | 403 | } |
| 403 | 404 | ||
| 404 | static inline void | 405 | static nokprobe_inline void |
| 405 | stop_critical_timing(unsigned long ip, unsigned long parent_ip, int pc) | 406 | stop_critical_timing(unsigned long ip, unsigned long parent_ip, int pc) |
| 406 | { | 407 | { |
| 407 | int cpu; | 408 | int cpu; |
| @@ -443,6 +444,7 @@ void start_critical_timings(void) | |||
| 443 | start_critical_timing(CALLER_ADDR0, CALLER_ADDR1, pc); | 444 | start_critical_timing(CALLER_ADDR0, CALLER_ADDR1, pc); |
| 444 | } | 445 | } |
| 445 | EXPORT_SYMBOL_GPL(start_critical_timings); | 446 | EXPORT_SYMBOL_GPL(start_critical_timings); |
| 447 | NOKPROBE_SYMBOL(start_critical_timings); | ||
| 446 | 448 | ||
| 447 | void stop_critical_timings(void) | 449 | void stop_critical_timings(void) |
| 448 | { | 450 | { |
| @@ -452,6 +454,7 @@ void stop_critical_timings(void) | |||
| 452 | stop_critical_timing(CALLER_ADDR0, CALLER_ADDR1, pc); | 454 | stop_critical_timing(CALLER_ADDR0, CALLER_ADDR1, pc); |
| 453 | } | 455 | } |
| 454 | EXPORT_SYMBOL_GPL(stop_critical_timings); | 456 | EXPORT_SYMBOL_GPL(stop_critical_timings); |
| 457 | NOKPROBE_SYMBOL(stop_critical_timings); | ||
| 455 | 458 | ||
| 456 | #ifdef CONFIG_FUNCTION_TRACER | 459 | #ifdef CONFIG_FUNCTION_TRACER |
| 457 | static bool function_enabled; | 460 | static bool function_enabled; |
| @@ -611,6 +614,7 @@ void tracer_hardirqs_on(unsigned long a0, unsigned long a1) | |||
| 611 | if (!preempt_trace(pc) && irq_trace()) | 614 | if (!preempt_trace(pc) && irq_trace()) |
| 612 | stop_critical_timing(a0, a1, pc); | 615 | stop_critical_timing(a0, a1, pc); |
| 613 | } | 616 | } |
| 617 | NOKPROBE_SYMBOL(tracer_hardirqs_on); | ||
| 614 | 618 | ||
| 615 | void tracer_hardirqs_off(unsigned long a0, unsigned long a1) | 619 | void tracer_hardirqs_off(unsigned long a0, unsigned long a1) |
| 616 | { | 620 | { |
| @@ -619,6 +623,7 @@ void tracer_hardirqs_off(unsigned long a0, unsigned long a1) | |||
| 619 | if (!preempt_trace(pc) && irq_trace()) | 623 | if (!preempt_trace(pc) && irq_trace()) |
| 620 | start_critical_timing(a0, a1, pc); | 624 | start_critical_timing(a0, a1, pc); |
| 621 | } | 625 | } |
| 626 | NOKPROBE_SYMBOL(tracer_hardirqs_off); | ||
| 622 | 627 | ||
| 623 | static int irqsoff_tracer_init(struct trace_array *tr) | 628 | static int irqsoff_tracer_init(struct trace_array *tr) |
| 624 | { | 629 | { |
