Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp543215pxj; Thu, 20 May 2021 15:47:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4mCm585K+ZQVykW/+vKFlMa716dclD7PQK8+imPLJCQZI+5ipufhUC0ThvVhOgq/oqA76 X-Received: by 2002:a50:d54c:: with SMTP id f12mr7200436edj.301.1621550876793; Thu, 20 May 2021 15:47:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621550876; cv=none; d=google.com; s=arc-20160816; b=ndtt85PeoW+1dBSRZ19p/tnobAybbpNRGRIa5gQRCeVWjuoqvsatDeo2cftK1JoVek ewpf2MGVRelPX8yPTd2C9w4u10cOO4nrc520UPtlYMJISBdjkzkRLu18JxpWkS507hQk PJD2X5Di78jFG+kjZbG7rG1aRDw2BWKSWB//aP+oc/9Ih0Z6FXmbC4VixId+thW+PFIn /yORM8e5Kiugr8kNyTAy9e94CAkjEXkcOR7oKUFiicS2IfoBRqNZVqT1de93DfgCAnkD eNOPW+pf0su2m/Dt8ouUSLAUwEZL8AjnamAb6YQEdf1+18/A9OVmDJgwZQwiYCrS7xLf 9rgw== 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=+o9Y9NNfUPm9cQ+TFNv2hX6UYSj1daxw4/ltvpkViLo=; b=nnGxRcOiJNtRGmz9oU5mTD/BDuNYnBOPdD2dgTWNqzVFKQQv+3mtFh58Z+Y7925Wxx n2l1yLZu/Q21+vgeJa/FdI5D5WlTWQ5SfDt2mZ6bcLt+rHvqJms4FrnQQ3VreEEqdaY7 IKFHG12YZ7p84qPCMsNhFhaGB8OPVFPEduxe2pZUCPtg3W1nr8W8Z4q5WopA9AXuyBD0 YB42f+rGqMkmiD/6mvIl3KH5vq1bXL0mhf5/WAcWtqJfUG0PzOGxAyKfONUjBE/XEH5q 1elALMCYz2eamudQwsEgfXgu/8AKnFwAC9VK1GWZZlo+WtYTa6ZlEgLa+Ed2psU93uwl rSIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mVJm1Lp1; 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 k25si3908904ejg.471.2021.05.20.15.47.33; Thu, 20 May 2021 15:47:56 -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=mVJm1Lp1; 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 S239915AbhETLGt (ORCPT + 99 others); Thu, 20 May 2021 07:06:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:49512 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238398AbhETKsI (ORCPT ); Thu, 20 May 2021 06:48:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B7BDC61CB3; Thu, 20 May 2021 09:58:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504710; bh=IjhAkWEP1ZpF8POhkS0PDujjqG9kq38FL0A5mIfP19k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mVJm1Lp15dLLw6Jj/e6e6RU25OCNMoWQRFU7tjgM0vf5MY8/gZJgZsQxbv6A2vXXM basWV2Q3yA0dFdWGpHIzQPwJS8pCcCBHBwuU9eU4fskfaZvJesjdW2TjSs+yNCMBEC XiuHPWbDpfyJA9dxwoSPve74elsH5Kow8skmpffo= 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.9 046/240] scsi: lpfc: Fix crash when a REG_RPI mailbox fails triggering a LOGO response Date: Thu, 20 May 2021 11:20:38 +0200 Message-Id: <20210520092110.220902421@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092108.587553970@linuxfoundation.org> References: <20210520092108.587553970@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 fefef2884d59..30b5f65b29d1 100644 --- a/drivers/scsi/lpfc/lpfc_nportdisc.c +++ b/drivers/scsi/lpfc/lpfc_nportdisc.c @@ -1606,8 +1606,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 08c76c361e8d..0e7915ecb85a 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -15252,7 +15252,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