diff --git a/kernel/kprobes.c b/kernel/kprobes.c index f8ea8cf694c6cb..3de56ca2801713 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c @@ -1792,7 +1792,13 @@ static int __unregister_kprobe_top(struct kprobe *p) if ((list_p != p) && (list_p->post_handler)) goto noclean; } - ap->post_handler = NULL; + /* + * For the kprobe-on-ftrace case, we keep the + * post_handler setting to identify this aggrprobe + * armed with kprobe_ipmodify_ops. + */ + if (!kprobe_ftrace(ap)) + ap->post_handler = NULL; } noclean: /*