linux-stable/drivers/firmware/arm_ffa
Sudeep Holla dd925db6f0 firmware: arm_ffa: Fix a possible ffa_linux_errmap buffer overflow
The ffa_linux_errmap buffer access index is supposed to range from 0-8
but it ranges from 1-9 instead. It reads one element out of bounds. It
also changes the success into -EINVAL though ffa_to_linux_errno 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/20210707134739.1869481-1-sudeep.holla@arm.com
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2021-07-12 14:20:08 +01:00
..
Kconfig firmware: arm_ffa: Add support for SMCCC as transport to FFA driver 2021-05-26 22:36:46 +01:00
Makefile firmware: arm_ffa: Add support for SMCCC as transport to FFA driver 2021-05-26 22:36:46 +01:00
bus.c firmware: arm_ffa: Simplify probe function 2021-07-12 14:20:07 +01:00
common.h firmware: arm_ffa: Setup in-kernel users of FFA partitions 2021-05-26 22:38:43 +01:00
driver.c firmware: arm_ffa: Fix a possible ffa_linux_errmap buffer overflow 2021-07-12 14:20:08 +01:00
smccc.c firmware: arm_ffa: Add support for SMCCC as transport to FFA driver 2021-05-26 22:36:46 +01:00