Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2169171iof; Tue, 7 Jun 2022 22:02:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzUorDJ8KsmAi4J2Davy+p5lYsk4WmY3dooX9l+X6j8mI1Q6PSXjSVRk358i3k7DV20kxv X-Received: by 2002:a17:90b:1d04:b0:1e8:64e2:38c6 with SMTP id on4-20020a17090b1d0400b001e864e238c6mr20239525pjb.238.1654664560925; Tue, 07 Jun 2022 22:02:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654664560; cv=none; d=google.com; s=arc-20160816; b=mcq6ojVyObm6EsXsH9XV+PJ6mM2Jm53bbbuZXsV2BocV+dFBuAvvzIPJdt/yP8PMFK Xb5G/sUDxKFM6dukU18Ry2kKzFv87hkzFRHDHRbVZh/C4LW2JbV0LT0KbvTvP38tReMT J5Yazl6hc9myvx5RYPPBR6yuhorbZnBdjkdnBT0uTaN5wezQwCrU/6hzqtaButMXfZIa 4crueJ5JRibBC2ssBYO8cQ55BxtY1cPmDpR4VDDlKHqMPJ3Jb0cb9NegU8IkoJuh9jE1 505MMAAS1jQyea3/XHrhJe9933CDX2aL0tlK+GKGpgFJU1iqIg/d8ubj6OYGisItBAoy Vtfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=oMxXUumdigbflAL4c8E7qpLKhCuaHMkhMQm4v+i9p8A=; b=iaDl/Vvy2OlXVA6+HTwpuDrA5D+3w3r9pIrFBk+mPNu/bIKWi4gyTRK+NgMQzB7uUS WSpBKZo+N42OkhbYVW6NB88mx1fHMQwE7gigt9zBEXAMkceHFxBjw7sl8/1D23H86vhA +EaD5WJlV4fPuJvm+vHvotnhN8K09SqS2GHKByxu81cyIeoUyvSRPbHMcDx08gZY5aH2 uixApkugACQCDgvA7zeGjjzfR7b1WHUBS6pVzHaVyKP2lo1Ksy5ng16sS7bUWtLL/sM6 Q/+QsF3PAPyzvJ5EFeFCm3UPJka4xXFFczKpfKUu5b9EF5SfuStUJH1PQZckMt/zI9cd ZshA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pm43wSLk; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id s26-20020a65645a000000b003fbd7285a83si26262826pgv.817.2022.06.07.22.02.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:02:40 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pm43wSLk; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5DF123955FA; Tue, 7 Jun 2022 21:30:35 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1385782AbiFGWqo (ORCPT + 99 others); Tue, 7 Jun 2022 18:46:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381124AbiFGVgc (ORCPT ); Tue, 7 Jun 2022 17:36:32 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44772163F4C; Tue, 7 Jun 2022 12:04:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D8F65B8233E; Tue, 7 Jun 2022 19:04:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3CB14C34115; Tue, 7 Jun 2022 19:04:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628689; bh=pGs7DucsfOyXb3V7w2Exptx3i43BThzarD4FoLRpck0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pm43wSLkfAMCnxjKG27kyl364CM5RAcjuJhsECzPNGScuMZZWcWGr6uC1I+C73Lud 05CimDAQyl1XsOpMto3fZuzYkpEt1185mq45XVu7zkF6rEmYJz2AIC9sWu2ycUkC+P ewyJpzSDpxtmuGY95pzD5uwuQrJgaUJrgswSnSdY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Justin Tee , James Smart , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.18 413/879] scsi: lpfc: Fix dmabuf ptr assignment in lpfc_ct_reject_event() Date: Tue, 7 Jun 2022 18:58:51 +0200 Message-Id: <20220607165014.849610239@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: James Smart [ 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 Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/lpfc/lpfc_sli.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index c307f551d114..331241a71452 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -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); -- 2.35.1