bus: arm-ccn: Do not attempt to configure XPs for cycle counter
authorPawel Moll <pawel.moll@arm.com>
Fri, 5 Aug 2016 14:07:10 +0000 (15:07 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 24 Sep 2016 08:07:40 +0000 (10:07 +0200)
commitbd47c363ff8ca5e155c672849087a877ed594efb
tree9c737d9297ce98f5e80c3487ef707d30814a77ac
parent23d6ad91f35f6a2cae06dfe0d664c6c66d94bc65
bus: arm-ccn: Do not attempt to configure XPs for cycle counter

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 <mark.rutland@arm.com>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/bus/arm-ccn.c