Skip to contentSkip to conversation

Patch "bus: arm-ccn: Do not attempt to configure XPs for cycle counter" has been added to the 4.7-stable tree

PATCH [email protected] 1 participant 1 message Sep 22, 2016 Stable branch

lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

bus: arm-ccn: Do not attempt to configure XPs for cycle counter

to the 4.7-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
bus-arm-ccn-do-not-attempt-to-configure-xps-for-cycle-counter.patch
and it can be found in the queue-4.7 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From b7c1beb278e8e3dc664ed3df3fc786db126120a9 Mon Sep 17 00:00:00 2001

From: Pawel Moll <[email protected]>
Date: Fri, 5 Aug 2016 15:07:10 +0100
Subject: bus: arm-ccn: Do not attempt to configure XPs for cycle counter

From: Pawel Moll <[email protected]>

commit b7c1beb278e8e3dc664ed3df3fc786db126120a9 upstream.

Fuzzing the CCN perf driver revealed a small but definitely dangerous mistake in the event setup code. When a cycle counter is requested, the driver should not reconfigure the events bus at all, otherwise it will corrupt (in most but the simplest cases) its configuration and may end up accessing XP array out of its bounds and corrupting control registers.

---
 drivers/bus/arm-ccn.c |    4 ++++
 1 file changed, 4 insertions(+)
drivers/bus/arm-ccn.c +4 -0
@@ -895,6 +895,10 @@ static void arm_ccn_pmu_xp_dt_config(str
 	struct arm_ccn_component *xp;
 	u32 val, dt_cfg;
 
+	/* Nothing to do for cycle counter */
+	if (hw->idx == CCN_IDX_PMU_CYCLE_COUNTER)
+		return;
+
 	if (CCN_CONFIG_TYPE(event->attr.config) == CCN_TYPE_XP)
 		xp = &ccn->xp[CCN_CONFIG_XP(event->attr.config)];
 	else

Patches currently in stable-queue which might be from [email protected] are

queue-4.7/bus-arm-ccn-fix-xp-watchpoint-settings-bitmask.patch queue-4.7/bus-arm-ccn-do-not-attempt-to-configure-xps-for-cycle-counter.patch queue-4.7/bus-arm-ccn-fix-pmu-handling-of-mn.patch