Commit fabe38ab authored by Masami Hiramatsu's avatar Masami Hiramatsu Committed by Ingo Molnar

kprobes: Mark ftrace mcount handler functions nokprobe

Mark ftrace mcount handler functions nokprobe since
probing on these functions with kretprobe pushes
return address incorrectly on kretprobe shadow stack.
Reported-by: default avatarFrancis Deslauriers <francis.deslauriers@efficios.com>
Tested-by: default avatarAndrea Righi <righi.andrea@gmail.com>
Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
Acked-by: default avatarSteven Rostedt <rostedt@goodmis.org>
Acked-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
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>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/155094062044.6137.6419622920568680640.stgit@devboxSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 3ff9c075
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <linux/list.h> #include <linux/list.h>
#include <linux/hash.h> #include <linux/hash.h>
#include <linux/rcupdate.h> #include <linux/rcupdate.h>
#include <linux/kprobes.h>
#include <trace/events/sched.h> #include <trace/events/sched.h>
...@@ -6246,7 +6247,7 @@ void ftrace_reset_array_ops(struct trace_array *tr) ...@@ -6246,7 +6247,7 @@ void ftrace_reset_array_ops(struct trace_array *tr)
tr->ops->func = ftrace_stub; tr->ops->func = ftrace_stub;
} }
static inline void static nokprobe_inline void
__ftrace_ops_list_func(unsigned long ip, unsigned long parent_ip, __ftrace_ops_list_func(unsigned long ip, unsigned long parent_ip,
struct ftrace_ops *ignored, struct pt_regs *regs) struct ftrace_ops *ignored, struct pt_regs *regs)
{ {
...@@ -6306,11 +6307,13 @@ static void ftrace_ops_list_func(unsigned long ip, unsigned long parent_ip, ...@@ -6306,11 +6307,13 @@ static void ftrace_ops_list_func(unsigned long ip, unsigned long parent_ip,
{ {
__ftrace_ops_list_func(ip, parent_ip, NULL, regs); __ftrace_ops_list_func(ip, parent_ip, NULL, regs);
} }
NOKPROBE_SYMBOL(ftrace_ops_list_func);
#else #else
static void ftrace_ops_no_ops(unsigned long ip, unsigned long parent_ip) static void ftrace_ops_no_ops(unsigned long ip, unsigned long parent_ip)
{ {
__ftrace_ops_list_func(ip, parent_ip, NULL, NULL); __ftrace_ops_list_func(ip, parent_ip, NULL, NULL);
} }
NOKPROBE_SYMBOL(ftrace_ops_no_ops);
#endif #endif
/* /*
...@@ -6337,6 +6340,7 @@ static void ftrace_ops_assist_func(unsigned long ip, unsigned long parent_ip, ...@@ -6337,6 +6340,7 @@ static void ftrace_ops_assist_func(unsigned long ip, unsigned long parent_ip,
preempt_enable_notrace(); preempt_enable_notrace();
trace_clear_recursion(bit); trace_clear_recursion(bit);
} }
NOKPROBE_SYMBOL(ftrace_ops_assist_func);
/** /**
* ftrace_ops_get_func - get the function a trampoline should call * ftrace_ops_get_func - get the function a trampoline should call
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment