linux-stable/arch/x86/kernel/kprobes
Masami Hiramatsu a017784f1b kprobes/ftrace: Recover original IP if pre_handler doesn't change it
Recover original IP register if the pre_handler doesn't change it.
Since current kprobes doesn't expect that another ftrace handler
may change regs->ip, it sets kprobe.addr + MCOUNT_INSN_SIZE to
regs->ip and returns to ftrace.
This seems wrong behavior since kprobes can recover regs->ip
and safely pass it to another handler.

This adds code which recovers original regs->ip passed from
ftrace right before returning to ftrace, so that another ftrace
user can change regs->ip.

Link: http://lkml.kernel.org/r/20141009130106.4698.26362.stgit@kbuild-f20.novalocal

Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2014-11-20 11:42:48 -05:00
..
common.h kprobes/x86: Use text_poke_bp() instead of text_poke_smp*() 2013-07-19 09:57:04 +02:00
core.c kprobes/x86: Don't try to resolve kprobe faults from userspace 2014-07-16 14:16:32 +02:00
ftrace.c kprobes/ftrace: Recover original IP if pre_handler doesn't change it 2014-11-20 11:42:48 -05:00
Makefile kprobes/x86: Move kprobes stuff under arch/x86/kernel/kprobes/ 2013-01-21 13:22:37 -05:00
opt.c kprobes/x86: Free 'optinsn' cache when range check fails 2014-08-27 20:24:32 +02:00