diff options
author | Ewan D. Milne <emilne@redhat.com> | 2019-01-17 17:14:45 +0100 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2019-01-23 02:40:59 +0100 |
commit | c41f59884be5cca293ed61f3d64637dbba3a6381 (patch) | |
tree | f438ad4606805b8987231877def62d5d15ed5a50 /drivers/scsi/lpfc/lpfc_nvmet.h | |
parent | scsi: lpfc: nvme: avoid hang / use-after-free when destroying localport (diff) | |
download | linux-c41f59884be5cca293ed61f3d64637dbba3a6381.tar.xz linux-c41f59884be5cca293ed61f3d64637dbba3a6381.zip |
scsi: lpfc: nvmet: avoid hang / use-after-free when destroying targetport
We cannot wait on a completion object in the lpfc_nvme_targetport structure
in the _destroy_targetport() code path because the NVMe/fc transport will
free that structure immediately after the .targetport_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>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_nvmet.h')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_nvmet.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/lpfc/lpfc_nvmet.h b/drivers/scsi/lpfc/lpfc_nvmet.h index 1aaff63f1f41..0ec1082ce7ef 100644 --- a/drivers/scsi/lpfc/lpfc_nvmet.h +++ b/drivers/scsi/lpfc/lpfc_nvmet.h @@ -34,7 +34,7 @@ /* Used for NVME Target */ struct lpfc_nvmet_tgtport { struct lpfc_hba *phba; - struct completion tport_unreg_done; + struct completion *tport_unreg_cmp; /* Stats counters - lpfc_nvmet_unsol_ls_buffer */ atomic_t rcv_ls_req_in; |