Received: by 10.213.65.68 with SMTP id h4csp424497imn; Tue, 13 Mar 2018 08:38:23 -0700 (PDT) X-Google-Smtp-Source: AG47ELup47Ru5j71WEQL/6m997pa2rZTeqgJCBCihm/QRLEcsygKFb2hx+SHeWIRiZ0ISUJGeyrY X-Received: by 2002:a17:902:6e0f:: with SMTP id u15-v6mr986228plk.78.1520955503003; Tue, 13 Mar 2018 08:38:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520955502; cv=none; d=google.com; s=arc-20160816; b=LiebjHCG5sws59vZsn4Xl24Hqyy4ojACL3TNGHqBfdCS8BCOWLkFtgF1CcaSgu+vHU T/jZFTwTMr+BnTYvg+n+v0Dj7JInUrZ+92nqpTTITCyj0Zpp25RwW/6/sM2rBtkJwzoO NSopIRcWmYSYQQ/6WzRnIGjM5Ri5STx+nhiEpfEYBtHWJTI1rbc6OBG4OD1hWgBsk+UA mHer94yGTFb906PkskbkkpQ/OUeWmQkdT6QS3pNv04hlczZ3c0nA/VyxxwgTgeAP25lM xh4ncJTqfl2GtzHiujpRnZKBRr8bLh9p+3ewputRDr7p0BFz9gDNbUNyO57dgMsvGr4U Bn8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=D3z9iGZlAaCm3RoPMo9KFZ8e4MWHGZ49BgeGpCA7udA=; b=0KxsPW6nM924Ze0IMlSwT12z2e83T7005cB6+bCLuMVw9DxGwW+AyyMAdWMQJPf/ab nPWzkkMYEQqsp+fSQeqfHqFFRCC3PNgLQGkvmcpxySQKIEaghytDKWaEL4wNJZwhuyz7 228HHOiIGcFpPO4o6SQLato760JtDbM71aq96LFbxB4HBZxJji7FbAsWCg1F9owoJA40 dzIcIAmBbKwJFF1aFdv+fJXkOs6DlcL9ZNSv1ZVRA8ug2OTXoQ4hZbARtOLemh/xglQG lVsoa5uRhrSwGS71N2i27pllQsIMfqfbFRFEVcTHyEJF8yMRbtaTy4IcmOhEfNUv9daB lUrw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e127si276855pgc.170.2018.03.13.08.38.08; Tue, 13 Mar 2018 08:38:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753147AbeCMPgy (ORCPT + 99 others); Tue, 13 Mar 2018 11:36:54 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33700 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752158AbeCMPgv (ORCPT ); Tue, 13 Mar 2018 11:36:51 -0400 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 550C310DF; Tue, 13 Mar 2018 15:36:50 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Quinn Tran , Giridhar Malavali , Himanshu Madhani , Hannes Reinecke , "Martin K. Petersen" Subject: [PATCH 4.14 041/140] scsi: qla2xxx: Fix system crash in qlt_plogi_ack_unref Date: Tue, 13 Mar 2018 16:24:04 +0100 Message-Id: <20180313152500.890784748@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180313152458.201155692@linuxfoundation.org> References: <20180313152458.201155692@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Quinn Tran commit 19759033e0d0beed70421ab9258f5ede79e070ae upstream. Fix system crash due to NULL pointer access. qlt_plogi_ack_t and fc_port structures were not properly bound before calling qlt_plogi_ack_unref(). RIP: 0010:qlt_plogi_ack_unref+0xa1/0x150 [qla2xxx] Call Trace: qla24xx_create_new_sess+0xb1/0x320 [qla2xxx] qla2x00_do_work+0x123/0x260 [qla2xxx] qla2x00_iocb_work_fn+0x30/0x40 [qla2xxx] process_one_work+0x1f3/0x530 worker_thread+0x4e/0x480 kthread+0x10c/0x140 Fixes: 726b85487067d ("qla2xxx: Add framework for async fabric discovery") Cc: # 4.10+ Signed-off-by: Quinn Tran Signed-off-by: Giridhar Malavali Signed-off-by: Himanshu Madhani Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/qla2xxx/qla_os.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -4734,11 +4734,11 @@ void qla24xx_create_new_sess(struct scsi } else { list_add_tail(&fcport->list, &vha->vp_fcports); - if (pla) { - qlt_plogi_ack_link(vha, pla, fcport, - QLT_PLOGI_LINK_SAME_WWN); - pla->ref_count--; - } + } + if (pla) { + qlt_plogi_ack_link(vha, pla, fcport, + QLT_PLOGI_LINK_SAME_WWN); + pla->ref_count--; } } spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags);