From: Masami Hiramatsu Date: Thu, 9 Oct 2014 13:01:06 +0000 (+0000) Subject: kprobes/ftrace: Recover original IP if pre_handler doesn't change it X-Git-Tag: omap-for-v3.19/fixes-rc1~141^2~17 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a017784f1b236cbc42ce83b4345a667c21113481;p=pandora-kernel.git 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 Signed-off-by: Steven Rostedt --- Reading git-diff-tree failed