Skip to content

Commit 4f3a871

Browse files
rnavIngo Molnar
authored andcommitted
Revert "kprobes: Warn if optprobe handler tries to change execution path"
This reverts commit: e863d53 ("kprobes: Warn if optprobe handler tries to change execution path") On PowerPC, we place a probe at kretprobe_trampoline to catch function returns and with CONFIG_OPTPROBES=y, this probe gets optimized. This works for us due to the way we handle the optprobe as described in commit: 762df10 ("powerpc/kprobes: Optimize kprobe in kretprobe_trampoline()") With the above commit, we end up with a warning. As such, revert this change. Reported-by: Michael Ellerman <[email protected]> Signed-off-by: Naveen N. Rao <[email protected]> Cc: Ananth N Mavinakayanahalli <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Masami Hiramatsu <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 4b50239 commit 4f3a871

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

kernel/kprobes.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,10 +387,7 @@ void opt_pre_handler(struct kprobe *p, struct pt_regs *regs)
387387
list_for_each_entry_rcu(kp, &p->list, list) {
388388
if (kp->pre_handler && likely(!kprobe_disabled(kp))) {
389389
set_kprobe_instance(kp);
390-
if (kp->pre_handler(kp, regs)) {
391-
if (WARN_ON_ONCE(1))
392-
pr_err("Optprobe ignores instruction pointer changing.(%pF)\n", p->addr);
393-
}
390+
kp->pre_handler(kp, regs);
394391
}
395392
reset_kprobe_instance();
396393
}

0 commit comments

Comments
 (0)