Message ID | 20170323135847.21074-1-chad.dupuis@cavium.com (mailing list archive) |
---|---|
State | Accepted, archived |
Headers | show
Return-Path: <linux-scsi-owner@kernel.org> 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 56F6D6020B for <patchwork-linux-scsi@patchwork.kernel.org>; Thu, 23 Mar 2017 13:58:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4638F284F1 for <patchwork-linux-scsi@patchwork.kernel.org>; Thu, 23 Mar 2017 13:58:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3A8AC284F5; Thu, 23 Mar 2017 13:58:59 +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 55C04284F1 for <patchwork-linux-scsi@patchwork.kernel.org>; Thu, 23 Mar 2017 13:58:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935185AbdCWN66 (ORCPT <rfc822;patchwork-linux-scsi@patchwork.kernel.org>); Thu, 23 Mar 2017 09:58:58 -0400 Received: from mail-co1nam03on0080.outbound.protection.outlook.com ([104.47.40.80]:50688 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933432AbdCWN6z (ORCPT <rfc822;linux-scsi@vger.kernel.org>); Thu, 23 Mar 2017 09:58:55 -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=93dPrGB4N+bNexrcMs6ypTqDueYD/nCZorMbtcHi+bY=; b=cMFswGN/9caNZJTv0b4lcNkAmb73JUR7hH8B0RFfENXheSdPnH7o1IByNYx9tdcl3rMs39r1yXxk2xBDm/jnaZ8TvGQJ69wVLG4qDz/kn8VZerEAKPOXW3PUg5HAazXv8JJOl+rSHOT/Q3gkr1nsFRUbcLbmvWvi01WmTpYnY0o= Received: from BLUPR07CA0102.namprd07.prod.outlook.com (10.255.223.173) by BLUPR07MB467.namprd07.prod.outlook.com (10.141.202.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.977.11; Thu, 23 Mar 2017 13:58:49 +0000 Received: from BN1BFFO11FD001.protection.gbl (2a01:111:f400:7c10::1:147) by BLUPR07CA0102.outlook.office365.com (2a01:111:e400:841::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.977.11 via Frontend Transport; Thu, 23 Mar 2017 13:58:49 +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 BN1BFFO11FD001.mail.protection.outlook.com (10.58.144.64) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.977.7 via Frontend Transport; Thu, 23 Mar 2017 13:58:49 +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.309.2; Thu, 23 Mar 2017 06:58:47 -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 v2NDwlam021110; Thu, 23 Mar 2017 06:58:47 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id v2NDwlwv021109; Thu, 23 Mar 2017 06:58:47 -0700 From: "Dupuis, Chad" <chad.dupuis@cavium.com> To: <martin.petersen@oracle.com> CC: <linux-scsi@vger.kernel.org>, <james.bottomley@hansenpartnership.com>, <QLogic-Storage-Upstream@cavium.com> Subject: [PATCH] qedf: Fix crash due to unsolicited FIP VLAN response. Date: Thu, 23 Mar 2017 06:58:47 -0700 Message-ID: <20170323135847.21074-1-chad.dupuis@cavium.com> X-Mailer: git-send-email 2.12.0 MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39410400002)(39830400002)(39450400003)(2980300002)(428002)(189002)(199003)(9170700003)(80596001)(81166006)(8676002)(4326008)(33646002)(189998001)(2906002)(50466002)(50986999)(5660300001)(54906002)(86362001)(575784001)(2351001)(356003)(36756003)(110136004)(305945005)(87636002)(38730400002)(107886003)(6916009)(8936002)(48376002)(50226002)(101416001)(106466001)(42186005)(105586002)(1076002)(47776003)(5003940100001)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR07MB467; H:CAEXCH02.caveonetworks.com; FPR:; SPF:None; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD001; 1:CptrryBbTkL53sKMFzuqZz/emRx3qCNBtME8R4l6R1+Wo3jEcyUZ8zQP2GfD44Gy8wEHKC1LqV78WUdhGFIr3dp09fIf32Ce6O73N2LZtNKVaQXSqZRGYm0OFlbFkFJFc8P9ofx68aSXCxneNSajlV3LkVK9uDO2Q9sCL/ntDcfLSA/bEQ2tgMC5gd1F6QmIvsGe0joZ/lBPIVpF7Dp3yaUuDHrmkZaDsY6VqMwqWGINI+0tEJVLc5XD2VVfa9WlsAPztnu2Odhb1/U2q6Y5K7PjWC/Nmgr9KpfrscO+vkxwq5yqtrJNuFqoSnBd+hmqvvOS9QFs5mUuHJPHRoPLbalGZbTZwr/tEAji731KbUMMRIlA8JkbRo+2F6f9NDd/2WKqIE5Kphf/SfYsOjvBNgYacPyCh90oVdu5jCQuIszXBzXuKK8XkAiS08zgjZhiBwNORfm33vM+mbjyNNJlzHU9C1EYm1WO50xIr4jm0o6Lphad+amzSOYkl4/Ta+E6 X-MS-Office365-Filtering-Correlation-Id: 20d63422-3ef2-4f01-4c29-08d471f4bb70 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075); SRVR:BLUPR07MB467; X-Microsoft-Exchange-Diagnostics: 1; BLUPR07MB467; 3:s35rXFgW8cLJVetmBBTQB0n0EIoa2m7WzM+V8+ZKEIxqBl75rcRE5rc9GrGPsSSlznqdhJXT3xdfgRbh47WOuLBZ1lCMEuE6VQGwaaXYcecBwn4DqG7gUmuaydGJOTzTXkKXzF7Yu85PVADOXdl8XiNdzPrkV69yAU6Rsj1eRhBaYF4K1JULvN2uJx/h9ifLoFcwA7awVTpFcvnd+lLag6r0TulM1CmIBKXDErzK9JmMCORoAWGpmf/Cmni37rUBvBP/VKXwgli/BKHvlySnVTW/ucXMZXG+9GAM7OvNmzIlZOTl/y8fgZFwH7BPnpTaXS/zLdoOSgUor6DZTg9strEBrkwHv1N57lP38b1E8aXPXN8c4If9QG7muGKEHgQa9lWfqAziq1mX8M2qhDCrZQ==; 25:EJPtOjDE1w4cO23hwxpVhrsw8SMG5ENEAObcBafWp1Qh5oTkqC2m9l8Q5CvorEf61lf/5a8alQ928UIsRPbXmKwVwjU3k84UuxnG+hgz5EA8HwoOELaOBBbc31sIc+6nvBod+4thawN2+XTuqcsCvGGwyLP0Dva0Nzm259hz4FqehMqRPN2G8SDW8am10iZCDwET3NH8G2TpbDDttLYiK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zZ1TPDz2Ef/szlYAveWA4Wjl2FSjsFl X-Microsoft-Antispam-PRVS: <BLUPR07MB4679A20C68429B9B06C1DFA9E3F0@BLUPR07MB467.namprd07.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(209352067349851); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(13018025)(8121501046)(13015025)(13017025)(13024025)(13023025)(5005006)(10201501046)(3002001)(6041248)(20161123558025)(20161123560025)(20161123564025)(20161123562025)(20161123555025)(6072148); SRVR:BLUPR07MB467; BCL:0; PCL:0; RULEID:; SRVR:BLUPR07MB467; X-Microsoft-Exchange-Diagnostics: 1; BLUPR07MB467; 4:8Z2sLi0xH0mS24JEVluKMWyFASPyXsPvDvWWiERNBInaHyOFB2d96/UKISSal1uzlol9i48gLujGI/2FsxUuobVNm5pDsNuo/KfGG7khQtXUy05cDCuavVn6Mc9ym4udTxu9VuCinUGLc4KETJHogBfzmWBrukC1hVbl3CDXEMkG/lQENNOOeawkeKESS4tzGNQIt9PT0yM601UD96sxT4pTOxhDd3WUsxMdo8oetXba11R8CtiKvFgCjNvvqEOBPiYc4pWzNwa4QjeMTE87B3N+bYf6wFV+BonZU+zO4UY828ZA7Vo+0H/ELKhGEwyhtsRvkCpGjPKUQSPwLLcKG8WQxN+nOAhuOwj3Tv3sBRvjmABfRkyFBosyrz7fB9YJ+NzcKSkcJ3du2V+xKz/B12MaObDH1kKFJ4j2iDI3U4KnELk32cNaLH9T0omAp2PM4uzzPor5/1oiYtwDMBJ/s95KOrzqVvy0K6vr/qmqxt5m+OLy3s2MtgfDke5iy9D2+S3wt04Vgi1kID1dya+4ebbILoezN/9w/AeC36P/kZE+G0bjS1DjsoGHl3IWvEJOo7LGm5hjrzE2ayZnc0avzyk6e3ZZ4HOIJSA3zLDupbvf+NFEOjRnRXjdNZ9BK90n3rmdeNru14k/jPq2mkFI0+F9y4E9D6ViJtATFQV5hSElD9LhRNR+voaiVMBJwKCK3pJA1UrhdVDEY2R51UTEKAujuAVeIE1biypl0K6cti318TY8+mD8tPb4rU5o4rK5 X-Forefront-PRVS: 0255DF69B9 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR07MB467; 23:YfjhMe8XrhyC7LDVIf3NK/IftvNmv/lOje556lit3Z?= =?us-ascii?Q?3pLTXXMmHDwNw3HwQh3Sn81SuwrQfOJXodampGy+79FRALZO0LQCLSolNhEC?= =?us-ascii?Q?JdPWdNEKm6ksf5GXCjYgH35lJZX4WG/SbthOF0vMdgFvvF/DlxYKMmTD3j3o?= =?us-ascii?Q?T7O5rzoBClSkbdzU/wlN9zc6qwTqBKwVIyjd4c0jq3I+cuGbhMZxAL3Xn109?= =?us-ascii?Q?rlRDVFPSH8mcK79ZV2FTfTIg+vY7ZBqNKdC607h0QXVWGFor35AehzkwgJoh?= =?us-ascii?Q?NGbc5FdFY9RVru8jzmzSDPqRvgV/D04/URgpooOrCjxz+J3dCIvUVNDnD+MU?= =?us-ascii?Q?IA5w24W2GT6VHwCn5mi2RRgw5dI3PxfzbWXwyl7YUcFYuvRiBewR4nUobXVT?= =?us-ascii?Q?Nk+mzFHNkM6aEkgI3dcEmTLj7R+oWsUc8zZF6kSsRc9eWRylktzpDZOiXoN1?= =?us-ascii?Q?DyKoQlUpRxlP/9ABWxUe3BErz9Ee9vgOEx82uhdfGFMxByetoVgRKEM0ILPj?= =?us-ascii?Q?xgMCWh/YyMpxl/GUKVPVZD9K0AzSiGHtSjROUoEI0DVyksvSq/0nfmjXD14b?= =?us-ascii?Q?rczEQq+VeCAqPqdB3Y4apAx5dVPt0/KLjnP43Ed8ztbbm8kjFaoJW/5utR2z?= =?us-ascii?Q?PmhlU7BGnYzG8JVGYutoCQjwtwCkVn3ljmnHxVyh4N3ntNfFrx0nE5XgbiIB?= =?us-ascii?Q?MCEe2aR8COt7lUr0PnEPXIXy6NJjEzG4Re5dJRrFrDycHXq34lojzszA6Iib?= =?us-ascii?Q?1JrldaPKMq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osticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR07MB467; 7:deFCDhpkDHTRhZS29flarAqFOXjQoTG1WclBoV5pVISzf2udODrDPj+WSoJ5IsG6rpI/YXuH/3uQHdoZ6je4YNG3bxxhdfh+H7z6jA7hCJb/yIAmwCY0tMyLrqrJG6F2XtHgDOX/gxvGWF6JWdyTd6YzqigXzpfLm3Qhpcy++um6No5lDo7JI8/MpTJrTc2Zx3gSF3scBRi4FFuqqF8W8s78w1C4gJbxo9Ai5+udeRuhJiX5oqWW92FsFJ7j3MPKO2iGUeNTDPcqmMOO91TnvezwCA434OzEYTPQyu1JGXmGq4fhBNWyGXoFUIzScpsDW/RRB0LCs22RQnGLRnLgHg== X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Mar 2017 13:58:49.2372 (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: BLUPR07MB467 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: <linux-scsi.vger.kernel.org> X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
"Dupuis, Chad" <chad.dupuis@cavium.com> writes: Chad, > We need to initialize qedf->fipvlan_compl in __qedf_probe so that if > we receive an unsolicited FIP VLAN response, the system doesn't crash > due to trying to complete an uninitialized completion. > > Also add a check to see if there are any waiters on the completion so > we don't inadvertantly kick start the discovery process due to the > unsolicited frame. Applied to 4.11/scsi-fixes.
diff --git a/drivers/scsi/qedf/qedf_fip.c b/drivers/scsi/qedf/qedf_fip.c index ed58b91..e10b91c 100644 --- a/drivers/scsi/qedf/qedf_fip.c +++ b/drivers/scsi/qedf/qedf_fip.c @@ -99,7 +99,8 @@ static void qedf_fcoe_process_vlan_resp(struct qedf_ctx *qedf, qedf_set_vlan_id(qedf, vid); /* Inform waiter that it's ok to call fcoe_ctlr_link up() */ - complete(&qedf->fipvlan_compl); + if (!completion_done(&qedf->fipvlan_compl)) + complete(&qedf->fipvlan_compl); } } diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c index 8e2a160..cceddd9 100644 --- a/drivers/scsi/qedf/qedf_main.c +++ b/drivers/scsi/qedf/qedf_main.c @@ -2803,6 +2803,7 @@ static int __qedf_probe(struct pci_dev *pdev, int mode) atomic_set(&qedf->num_offloads, 0); qedf->stop_io_on_error = false; pci_set_drvdata(pdev, qedf); + init_completion(&qedf->fipvlan_compl); QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_INFO, "QLogic FastLinQ FCoE Module qedf %s, "