From patchwork Tue May 23 13:19:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dupuis, Chad" X-Patchwork-Id: 9742553 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8640E6032C for ; Tue, 23 May 2017 13:19:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 74911287D7 for ; Tue, 23 May 2017 13:19:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 691AA287DA; Tue, 23 May 2017 13:19:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EEFA1287D7 for ; Tue, 23 May 2017 13:19:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937111AbdEWNTu (ORCPT ); Tue, 23 May 2017 09:19:50 -0400 Received: from mail-by2nam03on0048.outbound.protection.outlook.com ([104.47.42.48]:23360 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S937106AbdEWNTp (ORCPT ); Tue, 23 May 2017 09:19:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=z2HmGY0vpWnfCktmpAMXMuseDg/pv/9LBgsaM41x2xs=; b=J5Wv01FItKlG2260VkbEA0zPf9knWRP07dmSIexZIIcqFJ45iF9RwB3XbzhkAh9dfsJseaqXURe0eflM4E+4dIUP1FLGVf5hubxcpGCRdxrwVA6wymcomNwpnKiHucAfbo9ONlCLwPF8u1Za9FkC4Nl9pUNA70qXCY/HCBaYFys= Received: from CO2PR07CA0055.namprd07.prod.outlook.com (10.174.192.23) by BN1PR07MB424.namprd07.prod.outlook.com (10.141.59.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.14; Tue, 23 May 2017 13:19:43 +0000 Received: from BN1AFFO11FD028.protection.gbl (2a01:111:f400:7c10::166) by CO2PR07CA0055.outlook.office365.com (2603:10b6:100::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9 via Frontend Transport; Tue, 23 May 2017 13:19:43 +0000 Authentication-Results: spf=none (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; oracle.com; dkim=none (message not signed) header.d=none; oracle.com; dmarc=none action=none header.from=cavium.com; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BN1AFFO11FD028.mail.protection.outlook.com (10.58.52.88) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.1075.5 via Frontend Transport; Tue, 23 May 2017 13:19:42 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Tue, 23 May 2017 06:19:32 -0700 Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id v4NDJWwQ001832; Tue, 23 May 2017 06:19:32 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id v4NDJWD5001831; Tue, 23 May 2017 06:19:32 -0700 From: "Dupuis, Chad" To: CC: , , Subject: [PATCH 05/15] qedf: Check that fcport is offloaded before dereferencing pointers in initiate_abts|cleanup. Date: Tue, 23 May 2017 06:19:21 -0700 Message-ID: <20170523131931.1777-6-chad.dupuis@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170523131931.1777-1-chad.dupuis@cavium.com> References: <20170523131931.1777-1-chad.dupuis@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39400400002)(39410400002)(39850400002)(39840400002)(39450400003)(2980300002)(428002)(189002)(199003)(9170700003)(107886003)(72206003)(1076002)(38730400002)(478600001)(110136004)(36756003)(54906002)(50986999)(76176999)(305945005)(86362001)(356003)(2906002)(47776003)(50226002)(2351001)(8936002)(6916009)(106466001)(81166006)(5003940100001)(2950100002)(4326008)(8676002)(42186005)(6666003)(33646002)(105586002)(189998001)(5660300001)(101416001)(50466002)(48376002)(80596001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR07MB424; H:CAEXCH02.caveonetworks.com; FPR:; SPF:None; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD028; 1:cZmYhxPJLUa7hCzmRyUUO0jlEpUGGrkmWwZIGRaWH9noGGsK5jRt28GlI39IE8+hZVqCOdmhd3/Wea+BR88bCJjWyorMtEE2EcjNVHMquOcQ8gZi2X87pCB1OBo6R2zTLlG07PLMMCS9hwhRON6rRikdv0lDFsWlvax+V/shqWKdVL2esS9G6QvAqHl81Jkzl0jYyaycE+xLFWTYKbzZCKFwWm684Uf9bNz2hTeM+zSAa3nfwtSicc+5O+e/eUiVVk8VLh8XRIQOLbG5R45hSq0jsD+sOGd9oxjiqQONYQqIOMLE+qbxY1kFMy09Ao/q/KUZSI/mCd2oFO9sbgki8GyK+fiLZ5yBMgcEmX5Jr8u8OuhqRFzGRqxJohDkc/Fhb8T1pD+t5bMJNjpVJ++0qGk/jhvZvMYj2vyleNVeIYNXarqF09lkvhTIv/d1J7OthRZqx1KW51cpUqPwVHh0Dj9IqqUUjP0aDU99AqaR4L5T6/FJEa8VTYEDwmXcf4cznRhA2ygPIi1wswRIenXWsQ== X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PR07MB424: X-MS-Office365-Filtering-Correlation-Id: e3d09206-389d-4531-a3c4-08d4a1de5fe2 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081)(201702281549075); SRVR:BN1PR07MB424; X-Microsoft-Exchange-Diagnostics: 1; BN1PR07MB424; 3:Y9hRXKXIaub9qkiStr7UxYZbJOB+0LVIFeRK1jc7MHDaVS0fwNHHvlTpfnWGjKZYamx3S6oL52JsSB4k5KhGCjUu9PuYMjBpAMF62uwC2MxbD+NpLIKr33qoPRwZ0rWvpiU0np3AEFogmvrOXieOqoG/Nubb3okDVBImgE1b5M25azx1yBGfaArDnZUFophATN6SqIDxYeZIOme37fS+gGUU+gceX9Pm1zLZjWFJU48JhlHvDG+5yWI78eFi2NxSLjjLm5/A9T+XhsyfGoL0X2SPfvf3Ca5EfodjJXka1BqWFYdwwZ3SIeqEM9zyVFrcFYlYkBqq/eObvCVwA8reJdmOw4jAAfdLddj3n6GoIAfK6ki5Y8PudRcKCNJVH3KWpL659TSgJNfwWOPHsWJP7JfLEAnYbr8hcvg9FI6aGUJMqCIMK1/JWSWLisHL30xWimNqhFfJDh1bh45xs03iQJUGgnh3kTH8NiMGlExIbs7fF4ptDcZfFWzi8Cx35Uj4 X-Microsoft-Exchange-Diagnostics: 1; BN1PR07MB424; 25:5mvhbsJsQYpffPuTr2ZRb+JaXQe3ml2XahprjlTrJemEzyM2CuIGcN0KvmFA1uVErH9Ys8QD3k764DfVVxOi9Y42KqRHbfvvvuxzul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RnVJkGBd38h9MDOIE5IDCJPdaBFpVPyD+WkyKjZ9i4B2YNOxZ7lgSrEG1Js1jsU+TmowCnlaRpVw5ruNbFcs0BgmTo1ohF2Ir1xccLMFyP9iwh+1VRfp X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(13024025)(13018025)(13023025)(8121501046)(5005006)(13017025)(13015025)(10201501046)(93006095)(93001095)(3002001)(6041248)(20161123555025)(20161123562025)(20161123564025)(20161123560025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148); SRVR:BN1PR07MB424; BCL:0; PCL:0; RULEID:; SRVR:BN1PR07MB424; X-Microsoft-Exchange-Diagnostics: 1; BN1PR07MB424; 4:SWThzmv4z+filCuPllVxgLhmEyyrEFNNYctdkj1KzaVTfflyZd7oLpo3Zo7jDcY30qKBd+lYHmpNFsUdo9p77idWg4ql91/aLhUO12FtSwAc8vv425XG9BAck0eGI8H4YW9TzeCfLYkkAVJ3iptIbU7LEnKOibynwQMW6GMJLnFEvdrIA8Fv2z2Bx4MDUig/h78Zl6K6x6C/4n64gATiouJkcVh1xXhJtxfJ4hhLmHazzQQJv8sEP1WzYtZ12JIG48GSVHbbq7rc+OE5YTjMLygcTu1CsdIlL+oH3rVkyHppR6SbjmPyGl8YXAgYiZzXyuoWIb8jM+D2tC+ePF3+z8fz7ORHwMOijKT9Ss6k6Dyj/a4EBAPlqfy6fDj1sSsQdlsMrI8AoMiItlo7Lur6slEhQbICZqyUUnLlDslTSaQ2pX489X4zS+1kQxTzlBB8KXNRBvE5nN6Wc6fi8b/8TqRnbZ/pRS/TO8mPs6ivksg+ZLL+GRe/OYVBt7XJnROZhmxffPzxBKZFovD0VPdE78DVQ4/sL6Hjn0RQ5sdNxpFY8sD7Qgw8ndtz3SMbHUV659MBFiIFjjRUkqSYPuTpNpX3lk+j4r5UeTYTwT6qokH9k+yX630xzkShyc2gOdep4SLEJWJ9YzkOMqDoJbE4ssGh3lP8LXeLCKapIZ9xCnRylSdtoDLHByBdNmowy2qXPrZwRkkLqbcXv4eQjjXlhAQ3NpnAjTQgMgXIIFxeBWYmO/oyd8CxYL2A+hS5qCeAWGKCVWEC5gGzhfqYKH+HfoIxy3nAMksMqlwSaAvpisEdASbQ9nKQvCcM5DFcJZ4WEEGki/sscaPOYU/MlQ1LTsoSnUSCL0uTipYD44MgL2Pae9hwzBTXTHHgowbvHXDB X-Forefront-PRVS: 0316567485 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR07MB424; 23:o2lmOzoz04ywI0QQZJW5w9A/D7j/AzEJ1KloZK/7EN?= =?us-ascii?Q?MiGwmMCobECSmcQeLL+NBOzpqLCR9mqm+IR6/BdbUTjqqfHYC4p+ZiyElfyF?= =?us-ascii?Q?5twV1eJ217QJzOzPRZacOjvJcdTzL7fazimxYqbCqxv9h9Akgi3vF6iv2h8L?= =?us-ascii?Q?73kTyFeMu2KvT9sJufRWUlcbncYXJB91PF//DKXHHrW6Je+gychuqhNBmB+B?= =?us-ascii?Q?uSdxrZ6QjJ+jKhWTHRLsXUhRGsLrU7zIeWIpv51ewMwbtHk3M5D8keGP0IxO?= =?us-ascii?Q?xEfquCBl4d2L2JXuWPRphOcHEPyFZZiYpybtytRYUiYx/todKJVNWzRwLiju?= =?us-ascii?Q?VMDHi2/svMXsy5e8e647peaT4Rm9SAylPAuJIL7P608oTAFGn8Y1CvRzEeqq?= =?us-ascii?Q?YF18jpdQkYcQT0arfYnr5N5xVkN1za0aKAVbAEQkeyfGlWem7rrlHyVcAQTq?= =?us-ascii?Q?IoLMyvlYuv1mfnDZPJ7Z7DwFSG1OCxzN8xCWHN/N+8It1eNb5j09T/XUvFtn?= =?us-ascii?Q?761neNe67JYpr5SQx60mdrx72BL2E/5O6ujxqQiNg/+uIiu5Mv5YfugYiNkh?= =?us-ascii?Q?EKBuizdiirRIQYVpPjSEv4e5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R15SVZols+xwFZEPr3T7qDN8IxLlLuIfQeUdUZy5pxMXelMLUsE7HlxhCX1FNKYPxDSuLEETVe3W/HXNnkaSDxRQ/NXG7bINHwds5M58793g+OM/gSSl98AnOXTbTEPcTVP5su1a0itDg5pjS+0Tt0Ln8RmMkGts2dw==; 5:aFSmjVyhRyNAmsQusP5cCS6kYDsnk7WZGQBbQFHMU89tQMhsbT2aJolhuv0Jdv64kjhVVWCXyoSjAzpFYUlj4AM1yBUnl83vLHDLD9hoFElDpjck7RGyDUmb7VtPQey9qwbOh8hSuy6dgFfFZGNzgw==; 24:7dTIS/nxQyGs3/8ErOZyj63LBGI7GuXEXryn/LOz3AMxap7jW3bzlE5T0GAhwawpyoGjA5jh24RjDPOzzgvSmn2SkYxv5NnB5JajdOGOQyU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN1PR07MB424; 7:2jJrbDl7zBKb0vWGi2mB7Td+KbeMwXN0sa4NL9oBiKDxeMsb6AEKO28NP9PEd3vTRcN9HmkICK/aYlxywHJl7UasWNAgm/rtWF+mKjcY9I4t+LfEqXW6nqV68Cgt5W6wy4hGwcszz85g2YCtSDhKUa7AVSWdakRon3LCUnuek0hJmz7Gciu/dmMIvJujtFdbyUDMgQ+SQ9eyKVBw5MeDI7yHRlmBj3zF50/DJuZK8RcM6hsLcZfjKln4vJDir2WlKV2u79YYCFaHO1mTR0pMkSVWRgnNpvjD4sJw1J/i27gWpKT7sknczM0hFMMQSXqC56MzyA5TKPb42qsm1efFfA== X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2017 13:19:42.6150 (UTC) X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194; Ip=[50.232.66.26]; Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR07MB424 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If an fcport is not offloaded then the members of the qedf_rport struct are undefined which may cause a system crash. Signed-off-by: Chad Dupuis Reviewed-by: Bart Van Assche --- drivers/scsi/qedf/qedf_io.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/qedf/qedf_io.c b/drivers/scsi/qedf/qedf_io.c index ca9097b..db16004 100644 --- a/drivers/scsi/qedf/qedf_io.c +++ b/drivers/scsi/qedf/qedf_io.c @@ -1476,8 +1476,8 @@ int qedf_initiate_abts(struct qedf_ioreq *io_req, bool return_scsi_cmd_on_abts) { struct fc_lport *lport; struct qedf_rport *fcport = io_req->fcport; - struct fc_rport_priv *rdata = fcport->rdata; - struct qedf_ctx *qedf = fcport->qedf; + struct fc_rport_priv *rdata; + struct qedf_ctx *qedf; u16 xid; u32 r_a_tov = 0; int rc = 0; @@ -1485,15 +1485,18 @@ int qedf_initiate_abts(struct qedf_ioreq *io_req, bool return_scsi_cmd_on_abts) struct fcoe_wqe *sqe; u16 sqe_idx; - r_a_tov = rdata->r_a_tov; - lport = qedf->lport; - + /* Sanity check qedf_rport before dereferencing any pointers */ if (!test_bit(QEDF_RPORT_SESSION_READY, &fcport->flags)) { - QEDF_ERR(&(qedf->dbg_ctx), "tgt not offloaded\n"); + QEDF_ERR(NULL, "tgt not offloaded\n"); rc = 1; goto abts_err; } + rdata = fcport->rdata; + r_a_tov = rdata->r_a_tov; + qedf = fcport->qedf; + lport = qedf->lport; + if (lport->state != LPORT_ST_READY || !(lport->link_up)) { QEDF_ERR(&(qedf->dbg_ctx), "link is not ready\n"); rc = 1; @@ -1729,6 +1732,13 @@ int qedf_initiate_cleanup(struct qedf_ioreq *io_req, return SUCCESS; } + /* Sanity check qedf_rport before dereferencing any pointers */ + if (!test_bit(QEDF_RPORT_SESSION_READY, &fcport->flags)) { + QEDF_ERR(NULL, "tgt not offloaded\n"); + rc = 1; + return SUCCESS; + } + qedf = fcport->qedf; if (!qedf) { QEDF_ERR(NULL, "qedf is NULL.\n");