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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 Oct 2022 07:53:27 +0000 (09:53 +0200)
commite092fc3a28922c0b360f191bfe54895f02af8747
tree90602d52c61099e1622d2d4add37fe48217c2bf0
parent9f81dbb934fbd580687155112ec5fd4701e044c1
firmware: arm_scmi: Harden accesses to the sensor domains

[ Upstream commit 76f89c954788763db575fb512a40bd483864f1e9 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/firmware/arm_scmi/sensors.c