Patch "scsi: lpfc: Fix list_add() corruption in lpfc_drain_txq()" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    scsi: lpfc: Fix list_add() corruption in lpfc_drain_txq()

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     scsi-lpfc-fix-list_add-corruption-in-lpfc_drain_txq.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 69e66647a33fa0111bf58fef0c73a5bcfe4b6874
Author: James Smart <jsmart2021@xxxxxxxxx>
Date:   Fri Sep 10 16:31:46 2021 -0700

    scsi: lpfc: Fix list_add() corruption in lpfc_drain_txq()
    
    [ Upstream commit 99154581b05c8fb22607afb7c3d66c1bace6aa5d ]
    
    When parsing the txq list in lpfc_drain_txq(), the driver attempts to pass
    the requests to the adapter. If such an attempt fails, a local "fail_msg"
    string is set and a log message output.  The job is then added to a
    completions list for cancellation.
    
    Processing of any further jobs from the txq list continues, but since
    "fail_msg" remains set, jobs are added to the completions list regardless
    of whether a wqe was passed to the adapter.  If successfully added to
    txcmplq, jobs are added to both lists resulting in list corruption.
    
    Fix by clearing the fail_msg string after adding a job to the completions
    list. This stops the subsequent jobs from being added to the completions
    list unless they had an appropriate failure.
    
    Link: https://lore.kernel.org/r/20210910233159.115896-2-jsmart2021@xxxxxxxxx
    Co-developed-by: Justin Tee <justin.tee@xxxxxxxxxxxx>
    Signed-off-by: Justin Tee <justin.tee@xxxxxxxxxxxx>
    Signed-off-by: James Smart <jsmart2021@xxxxxxxxx>
    Signed-off-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 40d6537e64dd6..e72fc88aeb40e 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -19171,6 +19171,7 @@ lpfc_drain_txq(struct lpfc_hba *phba)
 					fail_msg,
 					piocbq->iotag, piocbq->sli4_xritag);
 			list_add_tail(&piocbq->list, &completions);
+			fail_msg = NULL;
 		}
 		spin_unlock_irqrestore(&pring->ring_lock, iflags);
 	}



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux