Skip to content

Commit

Permalink
arm64: perf: fix event validation for software group leaders
Browse files Browse the repository at this point in the history
This is a port of c95eb31 ("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: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
  • Loading branch information
Will Deacon authored and Catalin Marinas committed Aug 20, 2013
1 parent 868f6fe commit ee7538a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/arm64/kernel/perf_event.c
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit ee7538a

Please sign in to comment.