From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:46128 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933483AbcIVNmO (ORCPT ); Thu, 22 Sep 2016 09:42:14 -0400 Subject: Patch "bus: arm-ccn: Do not attempt to configure XPs for cycle counter" has been added to the 4.4-stable tree To: pawel.moll@arm.com, gregkh@linuxfoundation.org, mark.rutland@arm.com Cc: , From: Date: Thu, 22 Sep 2016 15:41:39 +0200 Message-ID: <1474551699172210@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: 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.4-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.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From b7c1beb278e8e3dc664ed3df3fc786db126120a9 Mon Sep 17 00:00:00 2001 From: Pawel Moll 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 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. Reported-by: Mark Rutland Reviewed-by: Mark Rutland Tested-by: Mark Rutland Signed-off-by: Pawel Moll Signed-off-by: Greg Kroah-Hartman --- drivers/bus/arm-ccn.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/bus/arm-ccn.c +++ b/drivers/bus/arm-ccn.c @@ -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 pawel.moll@arm.com are queue-4.4/bus-arm-ccn-fix-xp-watchpoint-settings-bitmask.patch queue-4.4/bus-arm-ccn-do-not-attempt-to-configure-xps-for-cycle-counter.patch queue-4.4/bus-arm-ccn-fix-pmu-handling-of-mn.patch