[PATCH] firmware: arm_scmi: Fix possible scmi_linux_errmap buffer overflow
Sudeep Holla
sudeep.holla at arm.com
Wed Jul 14 09:36:45 PDT 2021
On Wed, 7 Jul 2021 14:50:28 +0100, Sudeep Holla wrote:
> The scmi_linux_errmap buffer access index is supposed to depend on the
> array size to prevent element out of bounds access. It uses SCMI_ERR_MAX
> to check bounds but that can mismatch with the array size. It also
> changes the success into -EIO though scmi_linux_errmap is never used in
> case of success, it is expected to work for success case too.
>
> It is slightly confusing code as the negative of the error code
> is used as index to the buffer. Fix it by negating it at the start and
> make it more readable.
Applied to sudeep.holla/linux (for-next/scmi), thanks!
[1/1] firmware: arm_scmi: Fix possible scmi_linux_errmap buffer overflow
https://git.kernel.org/sudeep.holla/c/7a691f16cc
--
Regards,
Sudeep
More information about the linux-arm-kernel
mailing list