Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2483903pxj; Mon, 10 May 2021 04:12:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhDSkHu5JoTU8WKT0WKlcHKjm15u3z0mB4gh3cTePgPLuEjG/KOvztdqaZksAoX+PLGiTV X-Received: by 2002:a05:6638:f11:: with SMTP id h17mr20550810jas.102.1620645125609; Mon, 10 May 2021 04:12:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620645125; cv=none; d=google.com; s=arc-20160816; b=tqXaFoKh339ouRWTUFqdMUmGsQII1722hA0nkueOu/FicEtNW+29vxhtHsJg1GA2gl nyKDnD9e38gJGiFG5TyRWo28BS/E/NjyHZpQkLTU5E/ejXLjJgeUFje3cWQPPeRQfRL1 RlrS267NBw7iQWixmj5v1Zx93lmmh+t1TyzVNwpDrkCVh5mIg9IvQ/e5JVNOylRX+XU5 Li86XyV/XZSwiZkib8W2sjldmMV8uIjnwmkRA4Z+qLB5TS6BdOoipTvrZNqE3qv4hOfF SXmUzf+4v/ihssuqVGaDxolgm+5YAVeUty4nt1t+QeYU8Br7cJBuEwySn4qwvJNGE6W1 f2VQ== 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=wEmXj58WyFOZnokru9LWL7kxMIhOPDBYIZ331Pylxwg=; b=hXs/mDs3sgu58DkMML+XWDqbw2GAQx3XRlN7HNB2G7z37v31Zps0tpflM0SKxhmQDD PMOkTvt2drFpplK9btjZcwqWent/FD/mhxrPQT1Ea2YUGg1OG+rC34BsuBQBSg+8AC8N 0tubCuDF6/H8auX/956i1WRWLyZMIs8E3wPAfZBwuEAt1Wpwsv7GiX3WR/5L4Cq3oeK7 vjM9eCMYjs/83cau6WXNDRrDVOcoi+pNCaW7Z8arhkYzWgb9JIbCDo7g72bnAXz4hVPh oYOUO+rPIfQsyB55bK/ZtPTyxJjinLPZBqjHCWmtE5v1gzv2HaWU7Jk7bV7xcJgtMONs TLJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FUEEsP+O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n6si16638044jal.41.2021.05.10.04.11.53; Mon, 10 May 2021 04:12:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FUEEsP+O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237025AbhEJLLK (ORCPT + 99 others); Mon, 10 May 2021 07:11:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:41732 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233506AbhEJKuL (ORCPT ); Mon, 10 May 2021 06:50:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A1B6D6194C; Mon, 10 May 2021 10:39:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643163; bh=rQxWEvOyRAkO/4QIAnwkAluSpynfxtNNULUezbf5voo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FUEEsP+O5m3HGWJA3A7qiYfP7xetZQc+LxvJBWsKBB9QCwvDWkOXAHAkRg8yZMGCa M7FrCeBhcRKlm4xPy0sSKOTjttyUf62DpovI94BpbuhMRoBrZQdBNuNZOOnFv4j4M7 UItpJlgreyWYs24lk+ps+IlNsZA1G4YvI0S9SoyE= 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.10 196/299] scsi: lpfc: Fix crash when a REG_RPI mailbox fails triggering a LOGO response Date: Mon, 10 May 2021 12:19:53 +0200 Message-Id: <20210510102011.425534028@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: James Smart [ Upstream commit fffd18ec6579c2d9c72b212169259062fe747888 ] Fix a crash caused by a double put on the node when the driver completed an ACC for an unsolicted abort on the same node. The second put was executed by lpfc_nlp_not_used() and is wrong because the completion routine executes the nlp_put when the iocbq was released. Additionally, the driver is issuing a LOGO then immediately calls lpfc_nlp_set_state to put the node into NPR. This call does nothing. Remove the lpfc_nlp_not_used call and additional set_state in the completion routine. Remove the lpfc_nlp_set_state post issue_logo. Isn't necessary. Link: https://lore.kernel.org/r/20210412013127.2387-3-jsmart2021@gmail.com 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_nportdisc.c | 2 -- drivers/scsi/lpfc/lpfc_sli.c | 1 - 2 files changed, 3 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c index 17be94496110..6afcb1426e35 100644 --- a/drivers/scsi/lpfc/lpfc_nportdisc.c +++ b/drivers/scsi/lpfc/lpfc_nportdisc.c @@ -1984,8 +1984,6 @@ lpfc_cmpl_reglogin_reglogin_issue(struct lpfc_vport *vport, ndlp->nlp_last_elscmd = ELS_CMD_PLOGI; lpfc_issue_els_logo(vport, ndlp, 0); - ndlp->nlp_prev_state = NLP_STE_REG_LOGIN_ISSUE; - lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); return ndlp->nlp_state; } diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index f103340820c6..5841d2523549 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -17836,7 +17836,6 @@ lpfc_sli4_seq_abort_rsp_cmpl(struct lpfc_hba *phba, if (cmd_iocbq) { ndlp = (struct lpfc_nodelist *)cmd_iocbq->context1; lpfc_nlp_put(ndlp); - lpfc_nlp_not_used(ndlp); lpfc_sli_release_iocbq(phba, cmd_iocbq); } -- 2.30.2