diff options
author | Will Deacon <will.deacon@arm.com> | 2013-08-20 06:47:40 -0400 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2013-08-20 07:05:57 -0400 |
commit | ee7538a008a45050c8f706d38b600f55953169f9 (patch) | |
tree | 920114d21f6bf019a56cf1e63763378db0f73111 /arch/arm64 | |
parent | 868f6fea8fa63f09acbfa93256d0d2abdcabff79 (diff) |
arm64: perf: fix event validation for software group leaders
This is a port of c95eb3184ea1 ("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>
Diffstat (limited to 'arch/arm64')
-rw-r--r-- | arch/arm64/kernel/perf_event.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c index 2012646fb46f..12e6ccb88691 100644 --- a/arch/arm64/kernel/perf_event.c +++ b/arch/arm64/kernel/perf_event.c | |||
@@ -322,6 +322,9 @@ validate_event(struct pmu_hw_events *hw_events, | |||
322 | struct hw_perf_event fake_event = event->hw; | 322 | struct hw_perf_event fake_event = event->hw; |
323 | struct pmu *leader_pmu = event->group_leader->pmu; | 323 | struct pmu *leader_pmu = event->group_leader->pmu; |
324 | 324 | ||
325 | if (is_software_event(event)) | ||
326 | return 1; | ||
327 | |||
325 | if (event->pmu != leader_pmu || event->state <= PERF_EVENT_STATE_OFF) | 328 | if (event->pmu != leader_pmu || event->state <= PERF_EVENT_STATE_OFF) |
326 | return 1; | 329 | return 1; |
327 | 330 | ||