OpenCloudOS-Kernel/drivers/scsi/lpfc
James Smart 7740b615b6 scsi: lpfc: Fix possible ABBA deadlock in nvmet_xri_aborted()
The lpfc_sli4_nvmet_xri_aborted() routine takes out the abts_buf_list_lock
and traverses the buffer contexts to match the xri. Upon match, it then
takes the context lock before potentially removing the context from the
associated buffer list. This violates the lock hierarchy used elsewhere in
the driver of locking context, then the abts_buf_list_lock - thus a
possible deadlock.

Resolve by: after matching, release the abts_buf_list_lock, then take the
context lock, and if to be deleted from the list, retake the
abts_buf_list_lock, maintaining lock hierarchy. This matches same list lock
hierarchy as elsewhere in the driver

Link: https://lore.kernel.org/r/20210730163309.25809-1-jsmart2021@gmail.com
Reported-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-07-30 23:47:19 -04:00
..
Makefile scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc.h scsi: lpfc: Fix NVMe support reporting in log message 2021-07-18 22:30:34 -04:00
lpfc_attr.c scsi: lpfc: Add 256 Gb link speed support 2021-07-27 00:06:41 -04:00
lpfc_attr.h scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_bsg.c scsi: lpfc: Fix DMA virtual address ptr assignment in bsg 2021-04-26 22:57:27 -04:00
lpfc_bsg.h scsi: lpfc: Allow applications to issue Common Set Features mailbox command 2020-07-02 23:06:40 -04:00
lpfc_compat.h scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_crtn.h scsi: lpfc: Delay unregistering from transport until GIDFT or ADISC completes 2021-07-18 22:30:37 -04:00
lpfc_ct.c scsi: lpfc: Add 256 Gb link speed support 2021-07-27 00:06:41 -04:00
lpfc_debugfs.c scsi: lpfc: Fix node handling for Fabric Controller and Domain Controller 2021-05-21 23:23:28 -04:00
lpfc_debugfs.h scsi: lpfc: Make debugfs ktime stats generic for NVME and SCSI 2020-03-29 18:10:58 -04:00
lpfc_disc.h scsi: lpfc: Delay unregistering from transport until GIDFT or ADISC completes 2021-07-18 22:30:37 -04:00
lpfc_els.c scsi: lpfc: Add 256 Gb link speed support 2021-07-27 00:06:41 -04:00
lpfc_hbadisc.c scsi: lpfc: Add 256 Gb link speed support 2021-07-27 00:06:41 -04:00
lpfc_hw.h scsi: lpfc: Copyright updates for 14.0.0.0 patches 2021-07-27 00:06:41 -04:00
lpfc_hw4.h scsi: lpfc: Revise Topology and RAS support checks for new adapters 2021-07-27 00:06:41 -04:00
lpfc_ids.h scsi: lpfc: Copyright updates for 14.0.0.0 patches 2021-07-27 00:06:41 -04:00
lpfc_init.c scsi: lpfc: Add 256 Gb link speed support 2021-07-27 00:06:41 -04:00
lpfc_logmsg.h scsi: lpfc: Add an internal trace log buffer 2020-07-02 23:06:49 -04:00
lpfc_mbox.c scsi: lpfc: Revise Topology and RAS support checks for new adapters 2021-07-27 00:06:41 -04:00
lpfc_mem.c scsi: lpfc: Re-fix use after free in lpfc_rq_buf_free() 2020-10-26 21:42:38 -04:00
lpfc_nl.h scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_nportdisc.c scsi: lpfc: Skip issuing ADISC when node is in NPR state 2021-07-18 22:30:37 -04:00
lpfc_nvme.c scsi: lpfc: Delay unregistering from transport until GIDFT or ADISC completes 2021-07-18 22:30:37 -04:00
lpfc_nvme.h scsi: lpfc: Copyright updates for 12.8.0.11 patches 2021-07-18 22:30:38 -04:00
lpfc_nvmet.c scsi: lpfc: Fix possible ABBA deadlock in nvmet_xri_aborted() 2021-07-30 23:47:19 -04:00
lpfc_scsi.c scsi: lpfc: Revise Topology and RAS support checks for new adapters 2021-07-27 00:06:41 -04:00
lpfc_scsi.h scsi: lpfc: Copyright updates for 14.0.0.0 patches 2021-07-27 00:06:41 -04:00
lpfc_sli.c scsi: lpfc: Remove redundant assignment to pointer pcmd 2021-07-27 00:06:41 -04:00
lpfc_sli.h scsi: lpfc: vmid: Add datastructure for supporting VMID in lpfc 2021-06-10 10:01:32 -04:00
lpfc_sli4.h scsi: lpfc: Copyright updates for 12.8.0.11 patches 2021-07-18 22:30:38 -04:00
lpfc_version.h scsi: lpfc: Update lpfc version to 14.0.0.0 2021-07-27 00:06:41 -04:00
lpfc_vport.c scsi: lpfc: Update copyrights for 12.8.0.7 and 12.8.0.8 changes 2021-03-04 17:37:06 -05:00
lpfc_vport.h scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00