Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee7538a0 authored by Will Deacon's avatar Will Deacon Committed by Catalin Marinas
Browse files

arm64: perf: fix event validation for software group leaders



This is a port of c95eb318 ("ARM: 7809/1: perf: fix event validation
for software group leaders") to arm64, which fixes a panic in the arm64
perf backend found as a result of Vince's fuzzing tool.

Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent 868f6fea
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -322,6 +322,9 @@ validate_event(struct pmu_hw_events *hw_events,
	struct hw_perf_event fake_event = event->hw;
	struct pmu *leader_pmu = event->group_leader->pmu;

	if (is_software_event(event))
		return 1;

	if (event->pmu != leader_pmu || event->state <= PERF_EVENT_STATE_OFF)
		return 1;