Message ID | 160010377221.15536.8797457304463305492.tip-bot2@tip-bot2 |
---|---|
State | New |
Headers | show |
Series | [tip:,perf/kprobes] kprobes: Fix to check probe enabled before disarm_kprobe_ftrace() | expand |
diff --git a/kernel/kprobes.c b/kernel/kprobes.c index 732a701..3b61ae8 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c @@ -2235,9 +2235,10 @@ static void kill_kprobe(struct kprobe *p) /* * The module is going away. We should disarm the kprobe which - * is using ftrace. + * is using ftrace, because ftrace framework is still available at + * MODULE_STATE_GOING notification. */ - if (kprobe_ftrace(p)) + if (kprobe_ftrace(p) && !kprobe_disabled(p) && !kprobes_all_disarmed) disarm_kprobe_ftrace(p); }