]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - include/linux/kprobes.h
x86/kprobes: Verify stack frame on kretprobe
authorMasami Hiramatsu <mhiramat@kernel.org>
Sat, 23 Feb 2019 16:49:52 +0000 (01:49 +0900)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commitbb1752a11b06f36b557a05e72e1eb0567cdfda10
tree0b240958ac0a3e76c788f148366562f348aca408
parentbc689438c48ee667c48773009a4d069866581c53
x86/kprobes: Verify stack frame on kretprobe

BugLink: https://bugs.launchpad.net/bugs/1838349
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
arch/x86/kernel/kprobes/core.c
include/linux/kprobes.h