Received: by 10.213.65.68 with SMTP id h4csp2116794imn; Sun, 8 Apr 2018 20:07:45 -0700 (PDT) X-Google-Smtp-Source: AIpwx481tjQuhWS0p4ZNqFzZARvOoFnUIytGa3s1LIwR5muTUScv9bKo+IOiiHvdOi8TpuEhHHi6 X-Received: by 2002:a17:902:830a:: with SMTP id bd10-v6mr35987677plb.322.1523243265847; Sun, 08 Apr 2018 20:07:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243265; cv=none; d=google.com; s=arc-20160816; b=OMMQmKU1DlOQH5AT/N/rlAfwRhJs9w2nsTWDyjGsmxpQOXxoR1Re4k49lmqk0SwwkJ 8m4JrQQFg/Y7YFHd1KNXD7SSa1HW05O2l5AokqxPZSnJ88d/ix7LNV4WaV0bqGVZQy6R MUkgMtkYQy36P1k16WfppDtKLA5ae6R+ROpp19yRUXdBFkh1/9MJp1c/gmEIzGrqRqnH WYhtagKNVNA0u8U48K8PkEWZJzX2yVcR1rB9gBypIUSkWp104mrQqAIMmCBdrI979UFd MmrUFRPa6Tc/cSmxQ8EX+rUGcXnrm3uR7WYlOIXdgkN8pT563nk2IMFSfk8ultrg35bL jthw== 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=LrxsDSqHVTnP36A/t749B3n8vfEbAGX5B52x1jTUtGM=; b=dFJk/tbFMikNfZ9hziDRrKvBWu+G21/zvcvST9a+0ndnYZzjniF3gfAqv9qVOB5Ai9 oGj6tEV8q62fdHaMzJlZzKRP5qsWxAxJuew3EMDRbbXavi4uCnDpKWLruqKZJtXkPXT+ g1TJ00nxTqf2JkC5P3TCFavNbN7Gt9mabu+NrN6gJbb+yJ9s+cLfr2L5FNWOh26xtbcd 99UFtCTaxfWA7Gtl899M7go4GOlHt/jmn7R9YTkbFWooW+lRzBx/9wtBzOImCCM+ElAq 6Ydynrs3sa3umD5XuQccD7VRYwmFm6GQ8F8jcYYGJwDSv4Br2SxdjK8G2uR9m7Oiam/k xPPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=PleOd7HU; 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 q8-v6si14094041plr.477.2018.04.08.20.07.09; Sun, 08 Apr 2018 20:07: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=PleOd7HU; 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 S1757406AbeDIBcq (ORCPT + 99 others); Sun, 8 Apr 2018 21:32:46 -0400 Received: from mail-sn1nam02on0135.outbound.protection.outlook.com ([104.47.36.135]:45331 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756595AbeDIAfr (ORCPT ); Sun, 8 Apr 2018 20:35:47 -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=LrxsDSqHVTnP36A/t749B3n8vfEbAGX5B52x1jTUtGM=; b=PleOd7HUqNuU+UTfvuBnNxTvitC3nrIspBurHcMXmhmjeI3VyT/SjRH/07P50qWfCFjjE95QlcGIyhMeWi0rxWc3h0BpxH/DH31YjQLlpvhEd+oY+SaaH//OKeEG1CSCRBWlZhXHmA3q8vnuS5s+bnUHQ6j6tnPLSW+KV6CnJik= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0725.namprd21.prod.outlook.com (10.167.107.167) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:35:45 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:35:45 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Jeff Mahoney , Jeff Kirsher , Sasha Levin Subject: [PATCH AUTOSEL for 4.4 035/162] ixgbe: pci_set_drvdata must be called before register_netdev Thread-Topic: [PATCH AUTOSEL for 4.4 035/162] ixgbe: pci_set_drvdata must be called before register_netdev Thread-Index: AQHTz5mhr/Cg5g2TlUiC4BbEpb4Lcg== Date: Mon, 9 Apr 2018 00:28:07 +0000 Message-ID: <20180409002738.163941-35-alexander.levin@microsoft.com> References: <20180409002738.163941-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002738.163941-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;DM5PR2101MB0725;7:19BDKApWVDjUeP/jtXDZ6FbCkXM1rH5ZOhUMnv7ROmBcIuHe+ICRC2aXkCG9VhuGzu5JGmTrnBxk7lgMuZsF8ELR1qS5/XHqDcjkALJ0Iq1IcnCjThZj+GWpJyrzwy2tEOyH/aSw/mrWjMQtQkk1lMsu93NkQzAWsA5Uc2bD7wma78VhUGKm2cUb9vuHtHwzcApk1KOvNvhVhGyxAuSdX+5JX/GYWOZ70wZGbbvnDXUB8+hR0g1EkL74PEXEQS/j;20:lsngJ/gBpgd5iQpeQxv1iePTYIg5DZU7CTsCfoX1Azp/EeSxbZB4rwEgT+7Xtm/ftNWdCR6bvRZGuFQSOxcNLYWmO2a6fAY09sPn1FW8U084yesBMKXcAR5oE7iK/P8JyDRbZbqdQ4x3CxjARrsyy79H0HS4jJGSrxbeMj+EkmI= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 6f36b028-1d16-4ec0-a7b9-08d59db1d510 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0725; x-ms-traffictypediagnostic: DM5PR2101MB0725: 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)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3231221)(944501327)(52105095)(93006095)(93001095)(3002001)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB0725;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0725; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(396003)(376002)(39380400002)(346002)(366004)(189003)(199004)(86612001)(575784001)(102836004)(5660300001)(14454004)(476003)(68736007)(11346002)(66066001)(446003)(99286004)(76176011)(486006)(10090500001)(3660700001)(110136005)(305945005)(106356001)(316002)(105586002)(3280700002)(59450400001)(3846002)(10290500003)(6116002)(22452003)(6506007)(2616005)(1076002)(7736002)(54906003)(478600001)(2900100001)(2501003)(5250100002)(8936002)(25786009)(81156014)(8676002)(6666003)(6436002)(4326008)(26005)(6512007)(6486002)(81166006)(107886003)(53936002)(2906002)(86362001)(186003)(97736004)(36756003)(72206003)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0725;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: tACQXp9dSXLCDPZLpMDMUPpY0CjZmRJGqmwfuRCeLEyG2syJJfgAvq4eeMoQB95hjqFoeqD13+YNBaEFFw5RETAs4XupdRsdGXGeTrNN2YXfWmApFkV5K/h5LmkFbt45LwOG1f7pb1C2POdMBXOmpBZrxOtw3QnlKX4GQC9O3TlmknaS3VS/nT6r1bR0vysuYE4SJr9LyvYW3kwFwIJyzsXR7JTGH22ZDRtrvdQO1DLJxU06qCpm3qWarqmOMyjTXFibS6azMll3/3bQk6Lwy8GaWWLNFZ8hb4RMNI4IrjaWR7VyCmxux/NkBBJNnvgrsnYksqqYlJiE/caRySLDe0ERJ6s/IDDDsH1kBk/FYyCjU34yCBVhQWVPSQaD6/8MO4jFrqgm+jppA5uKkpxQf22qhdTzG46DWVGKEPwmO30= 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: 6f36b028-1d16-4ec0-a7b9-08d59db1d510 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:28:07.8486 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0725 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jeff Mahoney [ Upstream commit a09c0fc3f5d775231f1884e0e66c495065a461ee ] We call pci_set_drvdata immediately after calling register_netdev, which leaves a window where tasks writing to the sriov_numvfs sysfs attribute can sneak in and crash the kernel. register_netdev cleans up after itself so placing pci_set_drvdata immediately before it should preserve the intent of commit 0fb6a55cc31f ("ixgbe: fix crash on rmmod after probe fail"). Fixes: 0fb6a55cc31f ("ixgbe: fix crash on rmmod after probe fail") Signed-off-by: Jeff Mahoney Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/et= hernet/intel/ixgbe/ixgbe_main.c index 3283e8e1f409..72faaf4411b5 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c @@ -8963,11 +8963,11 @@ skip_sriov: "hardware.\n"); } strcpy(netdev->name, "eth%d"); + pci_set_drvdata(pdev, adapter); err =3D register_netdev(netdev); if (err) goto err_register; =20 - pci_set_drvdata(pdev, adapter); =20 /* power down the optics for 82599 SFP+ fiber */ if (hw->mac.ops.disable_tx_laser) --=20 2.15.1