Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp406444pxj; Thu, 20 May 2021 12:04:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxP+rFK7Tf2CCyYm9oHrbdr27/J1TIoKYnygI0WufDfZgI7NBhSMxKs5hGhvsNF7KgnbILV X-Received: by 2002:a05:6602:2013:: with SMTP id y19mr7152766iod.71.1621537488708; Thu, 20 May 2021 12:04:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621537488; cv=none; d=google.com; s=arc-20160816; b=07giAYLr3RJK5/npUakMkynwKLK/pQQ0eYTwK4H/OV/5BN3aOnojzxWgrPIEGVh7ix VI+1UumZR/FIn6bzIXjn9f4lbG39V66aQRVScYdBVDUE37WSt3JqB0cM3K+BETQw5RVY y4ttS9THWC1CSJuqLU6K4rHwP33a/Rzlk2j+ZKQW7t+azLt0VlWeoiLzunDi8ErhT7xN wP6A2yZGLQyH4qKCLrV/Yi0hFQHcewwCvKpnwOQFQYqaMjczVofH68IvnZd7vuAqfi5F 8iEJzLXZ+geY7Ec0Y6q5wWg/vveSc0HvtVoNsCBT00YWVzgCc6wXR265VC4bH2JpKhul pifg== 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=ecIUdwe3/PS+ZYGn5KQ1rAgM9125B092e0ME6BvgYas=; b=BRogZs70bgqgEFHPA9BO9c6XnBBl+V9MHrKmhVlykUvoZgqjxqbcOzwUfY9+NLhM7+ CfoLabfdgfFKMC9a//qJ32URg3mEbbltv0MwX+ZmnZaUPmLJfkHB3RPN55XeZWjb0Pxv HPJmB5daNy4qTvoMzEf8AuPEQqc1W0h8xb0+H0Gtad9BKZYWXGMuDTNBIJEKQ5xxSoYw nzwYGtDQyaQQqXEaE7cFe8wqQf/xyOhMh2OTzNPyg3b4XKLcI9+cwIuq/4C2B5+SIjnT Df/8+9YwDDsvIrvAdtO11sU5xKPbi4iIt6dHt9Iwzlxp51b+CpOuRtL79aXcAb11ACw9 RpQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=F9BtjtuM; 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 j5si3122308ilr.135.2021.05.20.12.04.34; Thu, 20 May 2021 12:04:48 -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=F9BtjtuM; 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 S235216AbhETKda (ORCPT + 99 others); Thu, 20 May 2021 06:33:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:51258 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236602AbhETKUI (ORCPT ); Thu, 20 May 2021 06:20:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8521561477; Thu, 20 May 2021 09:47:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504045; bh=l8yuecNHOrleM1sXka6sDMR2nkAdygJgohEMeZhx4BY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F9BtjtuMIvDsHxvQ4VL/dA+D+Ai/QD3pKDmas7Se+PWlNg/V5Eq7la1GZQhY50REH yjYvA5gBaQ7Tbj4k4tZzIyG49vwUpcRL4NJ9bWYqs1I+z26fZO7/afbcCs9oHgB/Hi n9Ed8joru/f4x17QJwu9N8WcJQeWhVx6Hrs9v/7E= 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.14 070/323] scsi: lpfc: Fix crash when a REG_RPI mailbox fails triggering a LOGO response Date: Thu, 20 May 2021 11:19:22 +0200 Message-Id: <20210520092122.500444758@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092120.115153432@linuxfoundation.org> References: <20210520092120.115153432@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 40c6d6eacea9..da6685700b04 100644 --- a/drivers/scsi/lpfc/lpfc_nportdisc.c +++ b/drivers/scsi/lpfc/lpfc_nportdisc.c @@ -1707,8 +1707,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 45445dafc80c..27578816d852 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -16637,7 +16637,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