]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: qedi: Fix use after free during abort cleanup
authorMike Christie <michael.christie@oracle.com>
Tue, 25 May 2021 18:18:14 +0000 (13:18 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 2 Jun 2021 05:28:22 +0000 (01:28 -0400)
commitce9e6712f67dceef8bbeb0e79f6f4e7f5c7d2b9f
treec95c6dec01c4e095915245a18e8408985aca122d
parent7b0d09681047aa0e7fd41a6ab076c9182ecd7bc8
scsi: qedi: Fix use after free during abort cleanup

If qedi_tmf_work's qedi_wait_for_cleanup_request call times out we will
also force the clean up of the qedi_work_map but
qedi_process_cmd_cleanup_resp could still be accessing the qedi_cmd.

To fix this issue we extend where we hold the tmf_work_lock and back_lock
so the qedi_process_cmd_cleanup_resp access is serialized with the cleanup
done in qedi_tmf_work and any completion handling for the iscsi_task.

Link: https://lore.kernel.org/r/20210525181821.7617-22-michael.christie@oracle.com
Reviewed-by: Manish Rangankar <mrangankar@marvell.com>
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qedi/qedi_fw.c
drivers/scsi/qedi/qedi_iscsi.h