summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@kernel.org>2019-02-24 01:49:52 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-04-27 09:36:37 +0200
commit1fab567a270b8fb2f2b80c00b5c8c8106d377be8 (patch)
tree9a4cc4f250d3293179297427785f05b4ecce7bd0 /include
parent5105fc758bdc4f7bb330248f1e2d2ea3b704421d (diff)
downloadlinux-stable-1fab567a270b8fb2f2b80c00b5c8c8106d377be8.tar.gz
linux-stable-1fab567a270b8fb2f2b80c00b5c8c8106d377be8.tar.bz2
linux-stable-1fab567a270b8fb2f2b80c00b5c8c8106d377be8.zip
x86/kprobes: Verify stack frame on kretprobe
commit 3ff9c075cc767b3060bdac12da72fc94dd7da1b8 upstream. Verify the stack frame pointer on kretprobe trampoline handler, If the stack frame pointer does not match, it skips the wrong entry and tries to find correct one. This can happen if user puts the kretprobe on the function which can be used in the path of ftrace user-function call. Such functions should not be probed, so this adds a warning message that reports which function should be blacklisted. Tested-by: Andrea Righi <righi.andrea@gmail.com> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Acked-by: Steven Rostedt <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/155094059185.6137.15527904013362842072.stgit@devbox Signed-off-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/kprobes.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index e909413e4e38..32cae0f35b9d 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -173,6 +173,7 @@ struct kretprobe_instance {
struct kretprobe *rp;
kprobe_opcode_t *ret_addr;
struct task_struct *task;
+ void *fp;
char data[0];
};