]> git.baikalelectronics.ru Git - kernel.git/commit
x86/kprobes: Verify stack frame on kretprobe
authorMasami Hiramatsu <mhiramat@kernel.org>
Sat, 23 Feb 2019 16:49:52 +0000 (01:49 +0900)
committerIngo Molnar <mingo@kernel.org>
Fri, 19 Apr 2019 12:26:05 +0000 (14:26 +0200)
commit0ac73289b14a54fe35f2c28aed72df60364046c2
tree68514aa6c9c1556f490fc7e729562f2b18a593f1
parent7c5f32120083af276531121a333797c631891311
x86/kprobes: Verify stack frame on kretprobe

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>
arch/x86/kernel/kprobes/core.c
include/linux/kprobes.h