]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: lpfc: Resolve NULL ptr dereference after an ELS LOGO is aborted
authorJames Smart <jsmart2021@gmail.com>
Fri, 3 Jun 2022 17:43:25 +0000 (10:43 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 8 Jun 2022 01:38:18 +0000 (21:38 -0400)
commit48fe9f2113b432499f9f5b9407112ac88160c029
treefa0714dc41f52c58e82f498d61f777ee792e277a
parent80fc6bb320dbcdf404a94fcaa9b8ef4f747bba20
scsi: lpfc: Resolve NULL ptr dereference after an ELS LOGO is aborted

A use-after-free crash can occur after an ELS LOGO is aborted.

Specifically, a nodelist structure is freed and then
ndlp->vport->cfg_log_verbose is dereferenced in lpfc_nlp_get() when the
discovery state machine is mistakenly called a second time with
NLP_EVT_DEVICE_RM argument.

Rework lpfc_cmpl_els_logo() to prevent the duplicate calls to release a
nodelist structure.

Link: https://lore.kernel.org/r/20220603174329.63777-6-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_els.c