]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: lpfc: nvme: avoid hang / use-after-free when destroying localport
authorEwan D. Milne <emilne@redhat.com>
Thu, 17 Jan 2019 16:14:44 +0000 (11:14 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 23 Jan 2019 01:40:59 +0000 (20:40 -0500)
commit5858068696b00bb67a2c4a5c0d47d78f8919406a
treeb8228d13b3fdbe6d6ae20cd41cbdd3627be94c61
parent2037be6a1ff5febe839794c1c525a77031034e93
scsi: lpfc: nvme: avoid hang / use-after-free when destroying localport

We cannot wait on a completion object in the lpfc_nvme_lport structure in
the _destroy_localport() code path because the NVMe/fc transport will free
that structure immediately after the .localport_delete() callback.  This
results in a use-after-free, and a hang if slub_debug=FZPU is enabled.

Fix this by putting the completion on the stack.

Signed-off-by: Ewan D. Milne <emilne@redhat.com>
Acked-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_nvme.c
drivers/scsi/lpfc/lpfc_nvme.h