firmware: arm_scmi: Harden accesses to the sensor domains
authorCristian Marussi <cristian.marussi@arm.com>
Wed, 17 Aug 2022 17:27:28 +0000 (18:27 +0100)
committerSudeep Holla <sudeep.holla@arm.com>
Mon, 22 Aug 2022 17:02:59 +0000 (18:02 +0100)
commit76f89c954788763db575fb512a40bd483864f1e9
treec9597c80b81c59101ed060b90fbd7c35517e8a50
parent1ecb7d27b1af6705e9a4e94415b4d8cc8cf2fbfb
firmware: arm_scmi: Harden accesses to the sensor domains

Accessing sensor domains descriptors by the index upon the SCMI drivers
requests through the SCMI sensor operations interface can potentially
lead to out-of-bound violations if the SCMI driver misbehave.

Add an internal consistency check before any such domains descriptors
accesses.

Link: https://lore.kernel.org/r/20220817172731.1185305-4-cristian.marussi@arm.com
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
drivers/firmware/arm_scmi/sensors.c