Linux/linux 3ff9c07arch/x86/kernel/kprobes core.c, include/linux kprobes.h

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 at gmail.com>
Signed-off-by: Masami Hiramatsu <mhiramat at kernel.org>
Acked-by: Steven Rostedt <rostedt at goodmis.org>
Cc: Linus Torvalds <torvalds at linux-foundation.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
Cc: Peter Zijlstra <peterz at infradead.org>
Cc: Thomas Gleixner <tglx at linutronix.de>
Cc: stable at vger.kernel.org
Link: http://lkml.kernel.org/r/155094059185.6137.15527904013362842072.stgit@devbox
Signed-off-by: Ingo Molnar <mingo at kernel.org>
DeltaFile
+26-0arch/x86/kernel/kprobes/core.c
+1-0include/linux/kprobes.h
+27-02 files

UnifiedSplitRaw