Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp61307pxj; Thu, 20 May 2021 04:36:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWLzKlxNlcQ4UPoPTeWwH2pwYi8QzGVGYn6+Cv3zk0UUqF3pCSj4tI0+mkhAUoFCXaroO7 X-Received: by 2002:a17:907:2dab:: with SMTP id gt43mr4323276ejc.369.1621510562068; Thu, 20 May 2021 04:36:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621510562; cv=none; d=google.com; s=arc-20160816; b=NsqmzSQ0GFh5N8c4SpVOhROg+94n6OEHGjL/hyC/Bd/aP0yGDTGhj1/Mzlt52Bm2+v Y6UceUzqHXo0v8Gobs76CjDZwUmtOAdxtRMFIDASv5PwR6pAGhp8w1ErD0gs1wRBcXdk WCwYlkVKZT3kOoShgqDapdI9mpnHR0eifSbSPcwE/vjUT4Mn0awv/a7PQY2ijRg+Z4+T 6I+gizxO50TL/vdpBoIkPkt724bsWDSQndzRIdDLmuh0DMwRjreMYoVnK9RYE5Sm+p7z eb8rvV7H/q1MoI9+a/fr8ZF4//Qe6PXLwBakiWwCu7DRW+JsMXzONgT6iBo60gV+nvDY EQcg== 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=c9vQNc4WNK1tEzJJldZHRctSk0Cg6i9xML0+1OHoCg4=; b=E4ObYy93Xhxw8GBufKaqgUuYxLIejJE3mj57Mafnbz/lm10mRNA1748wAQNNn6tRqm /9tvuUGiUAhtG0a9VOkWASNsBMIFluFR0/N7tIuLj+Z/DIFJkmXGghYcaKDiN118Mr26 f4weuRUzXhQqrRsm0ZQMR8/aqoFERESBna/NQotUt4SYKCh4WguQw/pQrfyPphtxGMS1 aZMCGs2Za3BgzsQQV8RQ/2UtyvdQGu9LgCcS4/dr38gmlGItQHVpAArZYVtMU/5KZ/5x bSODVBQKMnkRg5AwGs72qb4ebrBArATQ5FEXqUpxNclyuvRvVOYgPFiG3NTjdXUIIiOF iPIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aptVqqi+; 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 z26si2340089eje.396.2021.05.20.04.35.38; Thu, 20 May 2021 04:36:02 -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=aptVqqi+; 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 S241511AbhETLdc (ORCPT + 99 others); Thu, 20 May 2021 07:33:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:37196 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239471AbhETLNG (ORCPT ); Thu, 20 May 2021 07:13:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 26FA261D55; Thu, 20 May 2021 10:08:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621505282; bh=NnusT3g1kupXty5Ig/F4DpzN53olHto/uUZKxUFA9OU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aptVqqi+mpC9fw/IxiyXir/9XkpT2iXInvBzMwPAXj6wzPpUoTjdiV8xZfF8Iim9h clk338sqfWMF5r8s2pUIC/RFaeEWE5NYzruwqzs+nCzIXuvF+XlyzVmqKFl8rlFvXC F8IWruXB13u6qf/aOa8t8/RKMbMUP8+vsRJr/gVs= 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 4.4 037/190] scsi: lpfc: Fix crash when a REG_RPI mailbox fails triggering a LOGO response Date: Thu, 20 May 2021 11:21:41 +0200 Message-Id: <20210520092103.394973684@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092102.149300807@linuxfoundation.org> References: <20210520092102.149300807@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 6aa0698925da..1a44102b43c3 100644 --- a/drivers/scsi/lpfc/lpfc_nportdisc.c +++ b/drivers/scsi/lpfc/lpfc_nportdisc.c @@ -1604,8 +1604,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 97c0d79a2601..9055a8fce3d4 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -15049,7 +15049,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