]> git.baikalelectronics.ru Git - kernel.git/commit
firmware: arm_scmi: Validate BASE_DISCOVER_LIST_PROTOCOLS response
authorCristian Marussi <cristian.marussi@arm.com>
Wed, 30 Mar 2022 15:05:33 +0000 (16:05 +0100)
committerSudeep Holla <sudeep.holla@arm.com>
Thu, 28 Apr 2022 17:22:50 +0000 (18:22 +0100)
commitb503f82ed7cc740d1209f6372094d4d9f0d912ed
treef1ed3e5b8bb6ed2a17256c858387d6996b20b413
parent60dca36d2c6c9f0d0548c1127058849b5bb0ed71
firmware: arm_scmi: Validate BASE_DISCOVER_LIST_PROTOCOLS response

Do not blindly trust SCMI platform response about list of implemented
protocols, instead validate the reported length of the list of protocols
against the real payload size of the message reply.

Link: https://lore.kernel.org/r/20220330150551.2573938-5-cristian.marussi@arm.com
Fixes: 2f6e27266acb ("firmware: arm_scmi: add common infrastructure and support for base protocol")
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
[sudeep.holla: Added early break if loop_num_ret = 0 and simplified calc_list_sz
calculation]
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
drivers/firmware/arm_scmi/base.c