Received: by 10.213.65.68 with SMTP id h4csp1864056imn; Mon, 19 Mar 2018 15:37:45 -0700 (PDT) X-Google-Smtp-Source: AG47ELumbBGqp5M2jy6SpoHX03sWw8AqGHtezGmgRDv7hEvn5oe8LvGZJ/0MIoxKVQTjrXJ0XboZ X-Received: by 10.98.218.7 with SMTP id c7mr11529183pfh.162.1521499065590; Mon, 19 Mar 2018 15:37:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521499065; cv=none; d=google.com; s=arc-20160816; b=ozoAxTsTPJ51YaoeD8BDhVoq9x9v78Lmeect5dl9Lwag+A+R9eyLEXb3sEWIKS9coa r0272b5fvvnPxXzUJn/0R8qJ/YKunKMp9qq7drnSPhd9sGuZvgoljXMhPqbTiiOtj0yc aP7EWsqrd1B+RL8a1K7QyFAKR9ehwKL68ZdFgGcUDz25oDO+X4Wf6Nvhb0Y03EswT7wj UH/bAPq6HyQKCdbrHBa9zm0w0TMXSwoF/icJpBG+V5bqWGH5YWUCqVf/wkKlSfJfjyHd ElNQsiuXApgklLnyb9j08Y8g9bCM8X2Yb0TYtVfBwMVYCIh+nYwlpXgn6Zaos1R2lyUe VRdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=4bWnPNa4yFVUteSL1ZlhdBschUOYENQJiaI6KdIUtM8=; b=Uqtuc0vdvrl4S/caHirEduc9A0QUOZFn4XpwItVnupDMPcNjGqXuueF3ad3uQmv7R8 8n//j1an3iAAaX1t9XiOQkepB/5AKcuVD1frnzRvsROs+Yixc5AqCKrxp7k06HD98HOR LREO4GWzSiEAdSX8pqIWsnsK1MdAymvLyVlPM12qK/+ZFVhdPIbNlqlRKXKpJzyNK51f qf7IAWUujFWdy2aC3w2ClYXS8V9NKrIl+bLFkdnjFUZhjrWFLszGP/Zfbwb+AH/Vk2QT AlA/Oh1zt6fCT0U4VOFfxbPmgVzplDB/BFYdOoecEhxPViHN14bPwRv3zXKS9kIXvobc jaVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=CqmUcPG2; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j15si176351pga.418.2018.03.19.15.37.29; Mon, 19 Mar 2018 15:37:45 -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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=CqmUcPG2; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936579AbeCSWcV (ORCPT + 99 others); Mon, 19 Mar 2018 18:32:21 -0400 Received: from mail-co1nam03on0136.outbound.protection.outlook.com ([104.47.40.136]:48409 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933357AbeCSPsU (ORCPT ); Mon, 19 Mar 2018 11:48:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=4bWnPNa4yFVUteSL1ZlhdBschUOYENQJiaI6KdIUtM8=; b=CqmUcPG2+qiA6nffQRhQc0gs2sp9dI3YczsU7q+yBqq/9uphthdlxdKFnzQRxGuxpfvXCZ9F6gKwHY4IeK/W0taCx3ZCMhRoZczDFH/qCP03pMtNrsqnTM/eQl750PSm+8IrvbgephgOYl0yAzNO6UgbpoaLRIWZXZf9ngJmnSM= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0998.namprd21.prod.outlook.com (52.132.133.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.631.0; Mon, 19 Mar 2018 15:48:09 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62%5]) with mapi id 15.20.0631.004; Mon, 19 Mar 2018 15:48:09 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Quinn Tran , Himanshu Madhani , "Martin K . Petersen" , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 044/124] scsi: qla2xxx: Fix NULL pointer access for fcport structure Thread-Topic: [PATCH AUTOSEL for 4.15 044/124] scsi: qla2xxx: Fix NULL pointer access for fcport structure Thread-Index: AQHTv5mfXssIRhhBTEOjiN1YHe81tw== Date: Mon, 19 Mar 2018 15:47:45 +0000 Message-ID: <20180319154645.11350-44-alexander.levin@microsoft.com> References: <20180319154645.11350-1-alexander.levin@microsoft.com> In-Reply-To: <20180319154645.11350-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0998;7:8LhMooiq9tsMNSK7MGOW2QxwVvfv9Uc01EZX/cLWs9cb5xNMfcNQuU+Rk+fI+2gWbw3csfBuMaoxhziwOmiUizuydTUkb2hEJzx/+VPLKNKkhyLAzqiugr+MBTLETshM8fwtmCU9RJZjKWK/8xeQ4oOCQ52CMzOHSwfiJtqgdcu+IcPsCbbmbhm23jw4GiY5i7UFDeKWeAV1Ut+jaBTHWCaXC0WxMBxmHROIQbp5HX7IcOrc/nUQZDSW21dqfd5w;20:OdKscN8eXDsJD5coOHJvDuf4KOmxfuuGjsARHxo7avxvFvf7FP8Gv2K2rK1T3HyVfR5mh1aMTG4gYtJWd33RlnxzSVUCViLrM5N8GTnloaS3BxLTklily10zLZzM+5BmIjc/t2ImS6fhOiuPeyXN1+fzK14YZV2CyV0gUOj9I0k= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: afc713b9-760d-4cc3-b1d4-08d58db0d043 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0998; x-ms-traffictypediagnostic: DM5PR2101MB0998: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(146099531331640); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231221)(944501300)(52105095)(3002001)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB0998;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0998; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39380400002)(39860400002)(366004)(376002)(396003)(346002)(199004)(189003)(3846002)(6116002)(8936002)(6486002)(102836004)(68736007)(6506007)(2900100001)(22452003)(25786009)(3660700001)(7736002)(76176011)(6512007)(72206003)(86362001)(53936002)(8676002)(81156014)(6436002)(81166006)(305945005)(478600001)(99286004)(2950100002)(14454004)(6666003)(10290500003)(186003)(107886003)(2501003)(106356001)(26005)(86612001)(97736004)(5660300001)(10090500001)(110136005)(54906003)(316002)(2906002)(66066001)(105586002)(4326008)(36756003)(3280700002)(1076002)(5250100002)(59450400001)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0998;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: +Ms1UKfuVJRT0UfnwpAvOnb0/Tg6JXRF9OBhqU+Tz2Dp+fRZgPZqu7fMny3NjP63t/tAUME9nqQp1P5lus8TG0eZp1m+YGLDp1R/N1XrVan06HDZiJnRypf0xQkK8WB6Ti3d2IcBv9wCzXrMelitxGEwuKP/Y8n9E3gfTfz0oTWar7wpyJqdjIAgBZDsYfDP0vwxUQjzvj/f2flIxlFcGcMCFHRqWeDMOf6hUZkGggOk7jn5Wj5rQm2wAP9pkEF7i/ULaxfwfT8Q7KoVAbymOQ1ty6cQKdGSWcSZ8uD/7YA/kLkfaR2/QMOE21QMK2Ovtv5UCv2KU2CXipyq1Rnbaw== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: afc713b9-760d-4cc3-b1d4-08d58db0d043 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 15:47:45.1614 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0998 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Quinn Tran [ Upstream commit 5c25d451163cab9be80744cbc5448d6b95ab8d1a ] when processing iocb in a timeout case, driver was trying to log messages without verifying if the fcport structure could have valid data. This results in a NULL pointer access. Fixes: 726b85487067("qla2xxx: Add framework for async fabric discovery") Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/qla2xxx/qla_init.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_ini= t.c index 6082389f25c3..7b44a2c68a45 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -102,11 +102,16 @@ qla2x00_async_iocb_timeout(void *data) struct srb_iocb *lio =3D &sp->u.iocb_cmd; struct event_arg ea; =20 - ql_dbg(ql_dbg_disc, fcport->vha, 0x2071, - "Async-%s timeout - hdl=3D%x portid=3D%06x %8phC.\n", - sp->name, sp->handle, fcport->d_id.b24, fcport->port_name); + if (fcport) { + ql_dbg(ql_dbg_disc, fcport->vha, 0x2071, + "Async-%s timeout - hdl=3D%x portid=3D%06x %8phC.\n", + sp->name, sp->handle, fcport->d_id.b24, fcport->port_name); =20 - fcport->flags &=3D ~FCF_ASYNC_SENT; + fcport->flags &=3D ~FCF_ASYNC_SENT; + } else { + pr_info("Async-%s timeout - hdl=3D%x.\n", + sp->name, sp->handle); + } =20 switch (sp->type) { case SRB_LOGIN_CMD: --=20 2.14.1