Received: by 10.213.65.68 with SMTP id h4csp451209imn; Tue, 13 Mar 2018 09:27:36 -0700 (PDT) X-Google-Smtp-Source: AG47ELuWQeyWi4887ZjHM1AlBHvkui5JRE2jbtiXYturQm10glI/4RPXyMVqRB1WrGbqTpV4jV9E X-Received: by 10.99.145.193 with SMTP id l184mr945856pge.394.1520958456013; Tue, 13 Mar 2018 09:27:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520958455; cv=none; d=google.com; s=arc-20160816; b=HgaJkc8Xksj2JmWUt0vvEUN/4UhJarOYxKeJnnMnr+DvuYI7Is1tgwKI3WfW//MHhS Twq85m28e3ZvjeEO9TIa4QirsJdzWIgD1Gv9WdsS2Kbnn1DJ9bvjBtp/QjxHDIxxMsYp JAFPwaop8g6GIjpfmecraSYEJWWC9/AgFo6rVMJgZ9T4OTF3AgVtz++QtoJRbAjwaWC+ JSkK8TIsjAUnyQ6Bx6B57VERD0AfgPJWsxzwkZnnTdebwFPN3PKAdCjOzMU+Y9BZiy6Z K/QmZdf6lKBwg7g3vFT3FQ6VbFWMib1sB9ONgERmNcnjDW0Cx9rgG/2iM/V+yEPeCVZE kh2w== 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=jfh/qKyXGr74nSoJz3Plz6Eczw8NoQOh01XU10hKoF0=; b=NQSpfZOSb6Qg7ekN0LoE2+lz/SSkIarPQ8qOpAG+zgPYe9VmAwG30CgGbaHZzdr1PV ZdTbLlhk/8Ez5ND7q/mX3U3W2ExZ1BWryBKxGiBA3NvXwNembZiWJS/OJPJSSBQbUXgA 4uzscX7qtS9JwwwoMdw6lDtHv+r3Wz5ld14K0lykZJJGdWzFBpyfOgTn/qrQtGfWqvrA jBolFYHsYbOnEs5dTve3R0s0ttuajNVmHAUreujX7TFo+w7vGO/1BzxM19Boc4JS6yHt BorbCoRoJgZ4unkSrUj2PiREOKauMc9wTDtw2hrfnOcoz5W1a8mU5tB/GnvWP92Vmlp8 m51A== 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 n25si308758pgc.87.2018.03.13.09.27.21; Tue, 13 Mar 2018 09:27:35 -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 S933857AbeCMQYp (ORCPT + 99 others); Tue, 13 Mar 2018 12:24:45 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:32774 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933708AbeCMPeP (ORCPT ); Tue, 13 Mar 2018 11:34:15 -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 983801032; Tue, 13 Mar 2018 15:34:14 +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.15 142/146] scsi: qla2xxx: Fix system crash in qlt_plogi_ack_unref Date: Tue, 13 Mar 2018 16:25:09 +0100 Message-Id: <20180313152331.026527973@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180313152320.439085687@linuxfoundation.org> References: <20180313152320.439085687@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.15-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 @@ -4750,11 +4750,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);