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

!14400 bpf: Fix UAF via mismatching bpf_prog/attachment RCU flavors

parents 1e531b83 293a2597
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -2224,6 +2224,13 @@ void perf_event_detach_bpf_prog(struct perf_event *event)
		bpf_prog_array_free_sleepable(old_array);
	}

	/*
	 * It could be that the bpf_prog is not sleepable (and will be freed
	 * via normal RCU), but is called from a point that supports sleepable
	 * programs and uses tasks-trace-RCU.
	 */
	synchronize_rcu_tasks_trace();

	bpf_prog_put(event->prog);
	event->prog = NULL;