]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: lpfc: Fix memory overwrite during FC-GS I/O abort handling
authorJames Smart <jsmart2021@gmail.com>
Mon, 4 Oct 2021 23:12:10 +0000 (16:12 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 5 Oct 2021 03:37:08 +0000 (23:37 -0400)
commit26af839d941c99be05071e8bec5b3c426a9ddd9a
treec25adc360c010ac7998a012c14fa440b5ce2a585
parentd7d570994c85553aee87f0e5ad38fd360d301d64
scsi: lpfc: Fix memory overwrite during FC-GS I/O abort handling

When an FC-GS I/O is aborted by lpfc, the driver requires a node pointer
for a dereference operation.  In the abort I/O routine, the driver miscasts
a context pointer to the wrong data type and overwrites a single byte
outside of the allocated space.  This miscast is done in the abort I/O
function handler because the handler works on both FC-GS and FC-LS
commands. However, the code neglected to get the correct job location for
the node.

Fix this by acquiring the necessary node pointer from the correct job
structure depending on the I/O type.

Link: https://lore.kernel.org/r/20211004231210.35524-1-jsmart2021@gmail.com
Co-developed-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_sli.c