]> asedeno.scripts.mit.edu Git - linux.git/commit
scsi: lpfc: Fix kernel crash at lpfc_nvme_info_show during remote port bounce
authorJames Smart <jsmart2021@gmail.com>
Tue, 5 Nov 2019 00:57:00 +0000 (16:57 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 6 Nov 2019 05:04:03 +0000 (00:04 -0500)
commit6c1e803eac846f886cd35131e6516fc51a8414b9
tree50060f8409764300c79fa2db0a75c567bd961933
parent6bfb1620829825c01e1dcdd63b6a7700352babd9
scsi: lpfc: Fix kernel crash at lpfc_nvme_info_show during remote port bounce

When reading sysfs nvme_info file while a remote port leaves and comes
back, a NULL pointer is encountered. The issue is due to ndlp list
corruption as the the nvme_info_show does not use the same lock as the rest
of the code.

Correct by removing the rcu_xxx_lock calls and replace by the host_lock and
phba->hbaLock spinlocks that are used by the rest of the driver.  Given
we're called from sysfs, we are safe to use _irq rather than _irqsave.

Link: https://lore.kernel.org/r/20191105005708.7399-4-jsmart2021@gmail.com
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_attr.c