From: Robin Murphy Date: Mon, 3 Apr 2023 11:49:05 +0000 (+0100) Subject: perf/arm-cmn: Validate cycles events fully X-Git-Tag: v6.6.17~4923^2~6^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=23b2fd83948952ffee2e96ce6a982be9d8e96f9f;p=platform%2Fkernel%2Flinux-rpi.git perf/arm-cmn: Validate cycles events fully DTC cycle count events don't have anything to validate or initialise in themselves, but we should not forget to still validate their whole group context. Otherwise, we may fail to correctly reject a contrived group containing an impossible number of cycles events. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/3124e8c276a1f513c1a415dc839ca4181b3c8bc8.1680522545.git.robin.murphy@arm.com Signed-off-by: Will Deacon --- diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c index 9f2edc2..5a57c3f 100644 --- a/drivers/perf/arm-cmn.c +++ b/drivers/perf/arm-cmn.c @@ -1546,7 +1546,7 @@ static int arm_cmn_event_init(struct perf_event *event) type = CMN_EVENT_TYPE(event); /* DTC events (i.e. cycles) already have everything they need */ if (type == CMN_TYPE_DTC) - return 0; + return arm_cmn_validate_group(cmn, event); eventid = CMN_EVENT_EVENTID(event); /* For watchpoints we need the actual XP node here */