diff options
author | Sudeep Holla <[email protected]> | 2021-07-07 14:50:28 +0100 |
---|---|---|
committer | Sudeep Holla <[email protected]> | 2021-07-12 14:16:19 +0100 |
commit | 7a691f16ccad05d770f813d9c4b4337a30c6d63f (patch) | |
tree | c78e182c3ceb78e6b9f0df0eeeb9226399debb51 /tools/perf/scripts/python/export-to-sqlite.py | |
parent | 5e469dac326555d2038d199a6329458cc82a34e5 (diff) |
firmware: arm_scmi: Fix possible scmi_linux_errmap buffer overflow
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.
Link: https://lore.kernel.org/r/[email protected]
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
Reviewed-by: Cristian Marussi <[email protected]>
Signed-off-by: Sudeep Holla <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions