Unverified Commit 63744503 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!6864 [sync] PR-6835: kprobes: Fix check for probe enabled in kill_kprobe()

parents 0100bb0b 7a178244
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -2267,6 +2267,14 @@ static void kill_kprobe(struct kprobe *p)
	if (WARN_ON_ONCE(kprobe_gone(p)))
		return;

	/*
	 * The module is going away. We should disarm the kprobe which
	 * is using ftrace, because ftrace framework is still available at
	 * MODULE_STATE_GOING notification.
	 */
	if (kprobe_ftrace(p) && !kprobe_disabled(p) && !kprobes_all_disarmed)
		disarm_kprobe_ftrace(p);

	p->flags |= KPROBE_FLAG_GONE;
	if (kprobe_aggrprobe(p)) {
		/*
@@ -2283,14 +2291,6 @@ static void kill_kprobe(struct kprobe *p)
	 * the original probed function (which will be freed soon) any more.
	 */
	arch_remove_kprobe(p);

	/*
	 * The module is going away. We should disarm the kprobe which
	 * is using ftrace, because ftrace framework is still available at
	 * MODULE_STATE_GOING notification.
	 */
	if (kprobe_ftrace(p) && !kprobe_disabled(p) && !kprobes_all_disarmed)
		disarm_kprobe_ftrace(p);
}

/* Disable one kprobe */