aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2013-08-20 11:47:40 +0100
committerMark Brown <broonie@linaro.org>2014-05-14 12:15:40 +0100
commit4281a11a7e44655baa41241c470b09d4fae4be35 (patch)
tree500cdea6edf7aa2d511f5213213b79dcdec5a874
parent741dff38f169e49d8731e7362569fe4b1f9482de (diff)
downloadlinux-linaro-stable-4281a11a7e44655baa41241c470b09d4fae4be35.tar.gz
arm64: perf: fix event validation for software group leaders
commit ee7538a008a45050c8f706d38b600f55953169f9 upstream. 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. Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 6c6f6c7166e9ee45e545eab850a2862a92c135b2) Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--arch/arm64/kernel/perf_event.c3
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,
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;