scsi: lpfc: Check queue pointer before use
Subsystems (2)
PATCH 1/1 scsi: lpfc: Check queue pointer before use
The queue pointer might not be valid. The rest of the code checks the pointer before accessing it. lpfc_sli4_process_missed_mbox_completions is the only place where the check is missing.
---
Hi,
Not entirely sure if this correct. I tried to understand the logic of the mentioned patch but failed to grasps all the details. Anyway, we observe a crash in lpfc_sli4_process_missed_mbox_completions() while iterating the array. All but the last one entry has a valid pointer.
Thanks,
Daniel
drivers/scsi/lpfc/lpfc_sli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/lpfc/lpfc_sli.c +1 -1
@@ -7906,7 +7906,7 @@ lpfc_sli4_process_missed_mbox_completions(struct lpfc_hba *phba)if (sli4_hba->hdwq) {for (eqidx =0 ; eqidx < phba->cfg_irq_chann; eqidx++) { eq = phba->sli4_hba.hba_eq_hdl[eqidx].eq; -if (eq->queue_id == sli4_hba->mbx_cq->assoc_qid) { +if (eq && eq->queue_id == sli4_hba->mbx_cq->assoc_qid) { fpeq = eq;break ; }
Signature · 1 line
2.16.4
Quoted 26 lines · Daniel Wagner
The queue pointer might not be valid. The rest of the code checks the pointer before accessing it.
lpfc_sli4_process_missed_mbox_completionsis the only place where the check is missing.Fixes 657add4e5e15 ("scsi: lpfc: Fix poor use of hardware queues if fewer irq vectors")Cc James Smart <[email protected]>Signed-off-by Daniel Wagner <[email protected]>---
Hi,Not entirely sure if this correct. I tried to understand the logic of the mentioned patch but failed to grasps all the details. Anyway, we observe a crash in
lpfc_sli4_process_missed_mbox_completions()while iterating the array. All but the last one entry has a valid pointer.Thanks,
Danieldrivers/scsi/lpfc/lpfc_sli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/scsi/lpfc/lpfc_sli.c +0
-0
drivers/scsi/lpfc/lpfc_sli.c lpfc_sli4_process_missed_mbox_completions(struct lpfc_hba *phba) · line 7912
Quoted 8 lines
drivers/scsi/lpfc/lpfc_sli.c +1
-1@@ -7906,7 +7906,7 @@ lpfc_sli4_process_missed_mbox_completions(struct lpfc_hba *phba)if (sli4_hba->hdwq) {for (eqidx =0 ; eqidx < phba->cfg_irq_chann; eqidx++) { eq = phba->sli4_hba.hba_eq_hdl[eqidx].eq; -if (eq->queue_id == sli4_hba->mbx_cq->assoc_qid) { +if (eq && eq->queue_id == sli4_hba->mbx_cq->assoc_qid) { fpeq = eq;break ; }
looks fine. Thanks!
Reviewed by: James Smart <[email protected]>
-- james
Martin K. Petersen
AppliedDaniel,
Quoted 3 lines
The queue pointer might not be valid. The rest of the code checks the pointer before accessing it.
lpfc_sli4_process_missed_mbox_completionsis the only place where the check is missing.
Applied to 5.4/scsi-fixes, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering