kprobes/x86: Skip the assignment to ip when there is no post_handler
PATCH 1/1 kprobes/x86: Skip the assignment to ip when there is no post_handler
When there is no post_handler, the assignment to ip of regs is meaningless. So just skip it.
Signed-off-by Muchun Song <[email protected]>
--- arch/x86/kernel/kprobes/ftrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/kprobes/ftrace.c +1 -1
@@ -39,8 +39,8 @@ void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip,* Emulate singlestep (and also recover regs->ip) * as if there is a 5byte nop */ - regs->ip = (unsigned long )p->addr +MCOUNT_INSN_SIZE ;if (unlikely (p->post_handler)) { + regs->ip = (unsigned long )p->addr +MCOUNT_INSN_SIZE ; kcb->kprobe_status =KPROBE_HIT_SSDONE ; p->post_handler (p, regs,0 ); }
Signature · 1 line
2.11.0