linux_dsm_epyc7002/drivers/scsi/pm8001
yuuzheng c4186c00ad scsi: pm80xx: Fix pm8001_mpi_get_nvmd_resp() race condition
[ Upstream commit 1f889b58716a5f5e3e4fe0e6742c1a4472f29ac1 ]

A use-after-free or null-pointer error occurs when the 251-byte response
data is copied from IOMB buffer to response message buffer in function
pm8001_mpi_get_nvmd_resp().

After sending the command get_nvmd_data(), the caller begins to sleep by
calling wait_for_complete() and waits for the wake-up from calling
complete() in pm8001_mpi_get_nvmd_resp(). Due to unexpected events (e.g.,
interrupt), if response buffer gets freed before memcpy(), a use-after-free
error will occur. To fix this, the complete() should be called after
memcpy().

Link: https://lore.kernel.org/r/20201102165528.26510-5-Viswas.G@microchip.com.com
Acked-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Signed-off-by: yuuzheng <yuuzheng@google.com>
Signed-off-by: Viswas G <Viswas.G@microchip.com>
Signed-off-by: Ruksar Devadi <Ruksar.devadi@microchip.com>
Signed-off-by: Radha Ramachandran <radha@google.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-03-25 09:04:11 +01:00
..
Makefile
pm80xx_hwi.c scsi: pm80xx: Make running_req atomic 2021-03-25 09:04:11 +01:00
pm80xx_hwi.h
pm8001_chips.h
pm8001_ctl.c scsi: pm80xx: Increase number of supported queues 2020-10-07 23:50:04 -04:00
pm8001_ctl.h
pm8001_defs.h scsi: pm80xx: Increase the number of outstanding I/O supported to 1024 2020-10-07 23:50:04 -04:00
pm8001_hwi.c scsi: pm80xx: Fix pm8001_mpi_get_nvmd_resp() race condition 2021-03-25 09:04:11 +01:00
pm8001_hwi.h
pm8001_init.c scsi: pm80xx: Make running_req atomic 2021-03-25 09:04:11 +01:00
pm8001_sas.c scsi: pm80xx: Make running_req atomic 2021-03-25 09:04:11 +01:00
pm8001_sas.h scsi: pm80xx: Make running_req atomic 2021-03-25 09:04:11 +01:00