linux-stable/drivers/firmware/arm_scmi
Cristian Marussi 6e7978695f firmware: arm_scmi: Fix list protocols enumeration in the base protocol
[ Upstream commit 8009120e03 ]

While enumerating protocols implemented by the SCMI platform using
BASE_DISCOVER_LIST_PROTOCOLS, the number of returned protocols is
currently validated in an improper way since the check employs a sum
between unsigned integers that could overflow and cause the check itself
to be silently bypassed if the returned value 'loop_num_ret' is big
enough.

Fix the validation avoiding the addition.

Link: https://lore.kernel.org/r/20220330150551.2573938-4-cristian.marussi@arm.com
Fixes: b6f20ff8bd ("firmware: arm_scmi: add common infrastructure and support for base protocol")
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>
2022-06-09 10:26:04 +02:00
..
base.c firmware: arm_scmi: Fix list protocols enumeration in the base protocol 2022-06-09 10:26:04 +02:00
bus.c bus: Make remove callback return void 2021-07-21 11:53:42 +02:00
clock.c firmware: arm_scmi: Fix sorting of retrieved clock rates 2022-04-20 09:36:12 +02:00
common.h firmware: arm_scmi: Add virtio transport 2021-08-05 10:24:08 +01:00
driver.c firmware: arm_scmi: Remove clear channel call on the TX channel 2022-04-20 09:36:11 +02:00
Kconfig firmware: arm_scmi: Fix virtio transport Kconfig dependency 2021-09-20 11:50:57 +01:00
mailbox.c firmware: arm_scmi: Add priv parameter to scmi_rx_callback 2021-08-05 10:23:23 +01:00
Makefile firmware: arm_scmi: Add virtio transport 2021-08-05 10:24:08 +01:00
msg.c firmware: arm_scmi: Add message passing abstractions for transports 2021-08-05 10:23:23 +01:00
notify.c firmware: arm_scmi: Fix kernel doc warnings about return values 2021-07-13 11:39:54 +01:00
notify.h firmware: arm_scmi: Remove duplicate declaration of struct scmi_protocol_handle 2021-04-27 11:57:26 +01:00
perf.c firmware: arm_scmi: Add protocol modularization support 2021-03-30 16:35:16 +01:00
power.c firmware: arm_scmi: Add protocol modularization support 2021-03-30 16:35:16 +01:00
reset.c firmware: arm_scmi: Add protocol modularization support 2021-03-30 16:35:16 +01:00
scmi_pm_domain.c firmware: arm_scmi: pm: Propagate return value to caller 2021-11-17 11:24:50 +00:00
sensors.c firmware: arm_scmi: Fix type error in sensor protocol 2021-11-17 11:24:50 +00:00
shmem.c firmware: arm_scmi: Rename .clear_notification() transport_ops 2020-04-20 17:25:26 +01:00
smc.c firmware: arm_scmi: Add priv parameter to scmi_rx_callback 2021-08-05 10:23:23 +01:00
system.c firmware: arm_scmi: Add protocol modularization support 2021-03-30 16:35:16 +01:00
virtio.c virtio: wrap config->reset calls 2022-01-14 18:50:52 -05:00
voltage.c firmware: arm_scmi: Fix type error assignment in voltage protocol 2021-11-17 11:24:50 +00:00