]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
scsi: lpfc: Fix dmabuf ptr assignment in lpfc_ct_reject_event()
authorJames Smart <jsmart2021@gmail.com>
Fri, 6 May 2022 03:55:12 +0000 (20:55 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:30:09 +0000 (10:30 +0200)
[ Upstream commit 596fc8adb171dce3751a359018e2ade612af8d97 ]

Upon driver receipt of a CT cmd for type = 0xFA (Management Server) and
subtype = 0x11 (Fabric Device Management Interface), the driver is
responding with garbage CT cmd data when it should send a properly formed
RJT.

The __lpfc_prep_xmit_seq64_s4() routine was using the wrong buffer for the
reject.

Fix by converting the routine to use the buffer specified in the bde within
the wqe rather than the ill-set bmp element.

Link: https://lore.kernel.org/r/20220506035519.50908-6-jsmart2021@gmail.com
Fixes: 61910d6a5243 ("scsi: lpfc: SLI path split: Refactor CT paths")
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/lpfc/lpfc_sli.c

index c307f551d114aca0b807244a28902fab5c4ff7b2..331241a71452f841870ed6825552551730e1972c 100644 (file)
@@ -10800,24 +10800,15 @@ __lpfc_sli_prep_xmit_seq64_s4(struct lpfc_iocbq *cmdiocbq,
 {
        union lpfc_wqe128 *wqe;
        struct ulp_bde64 *bpl;
-       struct ulp_bde64_le *bde;
 
        wqe = &cmdiocbq->wqe;
        memset(wqe, 0, sizeof(*wqe));
 
        /* Words 0 - 2 */
        bpl = (struct ulp_bde64 *)bmp->virt;
-       if (cmdiocbq->cmd_flag & (LPFC_IO_LIBDFC | LPFC_IO_LOOPBACK)) {
-               wqe->xmit_sequence.bde.addrHigh = bpl->addrHigh;
-               wqe->xmit_sequence.bde.addrLow = bpl->addrLow;
-               wqe->xmit_sequence.bde.tus.w = bpl->tus.w;
-       } else {
-               bde = (struct ulp_bde64_le *)&wqe->xmit_sequence.bde;
-               bde->addr_low = cpu_to_le32(putPaddrLow(bmp->phys));
-               bde->addr_high = cpu_to_le32(putPaddrHigh(bmp->phys));
-               bde->type_size = cpu_to_le32(bpl->tus.f.bdeSize);
-               bde->type_size |= cpu_to_le32(ULP_BDE64_TYPE_BDE_64);
-       }
+       wqe->xmit_sequence.bde.addrHigh = bpl->addrHigh;
+       wqe->xmit_sequence.bde.addrLow = bpl->addrLow;
+       wqe->xmit_sequence.bde.tus.w = bpl->tus.w;
 
        /* Word 5 */
        bf_set(wqe_ls, &wqe->xmit_sequence.wge_ctl, last_seq);