Received: by 10.213.65.68 with SMTP id h4csp2120916imn; Sun, 8 Apr 2018 20:13:16 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/qtX+ZyemA3CnrEiXlk49XKAwtPqbshQW4sMBDtkOlr35YXuSN4ANv19J4pl2zViTehflb X-Received: by 10.99.113.70 with SMTP id b6mr7471441pgn.126.1523243509113; Sun, 08 Apr 2018 20:11:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243509; cv=none; d=google.com; s=arc-20160816; b=lXzMgmWKTJlB0HL0i4F6FefnlCx9Di1e+dSdj8/+8dvIxXQUL1yE3bH8HP5J1GIUz+ I48wSPh1jblNXkQ67yeaEL3ElC5r2INH2yLKljnkF8sWW3pQNtvlTAnAhm8O+PHyyoBX 3uV+LOEdWvDTI4PeyMLZusvNeo/YVTRb2AyVrzUKJRpxd5UZ/whN+sxBOfwJ7XuhhMlz tz5O2ALEqyAttPtxJDvXls087jBLST9dvEOs5/PHX25Fg2DtW/r+a7FTzWze7X3xHTpL gAbX/eLIVLOpxBl8D3JXs2gp36YsT0XKM28DPMo++D6ZyyUX8WwNQSYrHM7+ML068OhX T+ug== 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=RE1htkhaDR57IPzGSt98RC5O75rpGOwPf0pBMrJpc2U=; b=lIJTX+MwgHjViGtlE6bKn10c0UofFBDyaz83lwe3rnUBVmb8VK6sk5NgE4MAgMl5Zk ttb3pIslAOnPUUKVXYZD0z39CFZ7xjTEywCXuGZAcuAuqWGiGP5hWbdiQaoAGIx+E1vQ fjN4VRz6Nz6uOv0b7zMCmzYyZpXlby3au2Pzz0ZYOoQFdfddcEjUy0WPxsgLkrtsDmDJ gcEPghPX1jpE4m0Ni4RLC+AilBRtL4nKFkLEbtMvIhDgcX+VGT6LeaWJyDCu35OatE15 abZxAOa7O4iCROLgqS58gzlwvN5XzdR4YPkVdssLHzwsuLjUFsETfXMci3knGubdPRNk sPdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=AGR0HMnC; 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 x11-v6si13631570plm.326.2018.04.08.20.11.12; Sun, 08 Apr 2018 20:11:49 -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=AGR0HMnC; 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 S1757734AbeDICbe (ORCPT + 99 others); Sun, 8 Apr 2018 22:31:34 -0400 Received: from mail-sn1nam02on0134.outbound.protection.outlook.com ([104.47.36.134]:61393 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754724AbeDIA2U (ORCPT ); Sun, 8 Apr 2018 20:28: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=RE1htkhaDR57IPzGSt98RC5O75rpGOwPf0pBMrJpc2U=; b=AGR0HMnCOJnR8Mz0VdLUmzoZBEwQBhV8+2tTmlQAb3njSPeTnQ+duiHvQphwNrkk7P5pLoNVm70/gIFUDf3CLcqWFpg74/wa/pvt7B/O3oCfTp90bkeMFBiR4ZVJ+mlKCVPppDM0J6qEouPv7QhclcMq7dVfojh8Ux6XzEzs7Lg= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0871.namprd21.prod.outlook.com (10.167.110.167) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.2; Mon, 9 Apr 2018 00:28:12 +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:28:12 +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.9 070/293] ixgbe: pci_set_drvdata must be called before register_netdev Thread-Topic: [PATCH AUTOSEL for 4.9 070/293] ixgbe: pci_set_drvdata must be called before register_netdev Thread-Index: AQHTz5kHlOqupPkrr0yWqwlQsr/7/g== Date: Mon, 9 Apr 2018 00:23:48 +0000 Message-ID: <20180409002239.163177-70-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-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;DM5PR2101MB0871;7:5/kIwxQ/oLJ3UAEZThoBjQwfh2Ji1mo56jKGTdTkQqEvSl4ElilPjBvgERy6xOeB2QDOxoV0C8YKMKeuEtzJruXDxHQ0enxyjP4v2p98JYmAbuiSnzULQjbNLyaSDidZjmrNH5/4dKbBueN1vsMN/7SGTQJbyZlPnkSkRjqJnanLBY0XevaSiNBXik1+7FpyJ6LbXPzdZFdqiVIQ3x8CbTdNjGelYGO8UK6aGKxpIrJb7kS344wqcqSD41tlbbvO;20:SQxTXKb6qTWj+Op46xVj87ghPjC5m1YxChBql7Bl9eGR68M/7cOuN5n4qg8Fm93r/M8gno1yHF7wtKvzONT19AmRTGyqco7dsvY9wcgAzdyjJZUm7mNeoS6+qUSSAVHfqOuE+Xj5YoONcKfbDbmxVZcGcGKcXMxKrJRmLR3/95w= X-MS-Office365-Filtering-Correlation-Id: ee2311b9-2fed-4ff7-3c13-08d59db0c6f2 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(48565401081)(2017052603328)(7193020);SRVR:DM5PR2101MB0871; x-ms-traffictypediagnostic: DM5PR2101MB0871: 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)(8121501046)(5005006)(3231221)(944501327)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB0871;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0871; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(366004)(396003)(39380400002)(376002)(39860400002)(199004)(189003)(105586002)(8676002)(59450400001)(3660700001)(3280700002)(6506007)(81156014)(81166006)(14454004)(99286004)(72206003)(110136005)(8936002)(54906003)(305945005)(2906002)(316002)(10290500003)(478600001)(7736002)(53936002)(6512007)(486006)(11346002)(4326008)(86362001)(575784001)(446003)(3846002)(102836004)(76176011)(476003)(25786009)(22452003)(36756003)(107886003)(6666003)(10090500001)(5660300001)(6486002)(86612001)(6436002)(2616005)(68736007)(26005)(1076002)(186003)(2501003)(5250100002)(2900100001)(106356001)(66066001)(6116002)(97736004)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0871;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: tyaTs7nUCYLH1k9G4Fb2HLvVDH/nMeRstJQcyPPiae3oL5ZzMmYpXsGDtUjztR5Ta+xnKMQJdQ7L2Kf2m4Yz5msffWF3OfqC8wHR0fmUVmI1pEXQWumK2SYRiqPm5EtYGw32vi9wOVLXF4og4Ihx3j3Vxyj7glGjef6UfDppBRTSY5ZJBOQ09NAGROtpVq/Ra8MZKUb0x1ANfUg2RqrlkES0BSJq/wcHDmOnBG5UXIqa+DStq0uCbqtC5m3alSRTRvRTAfvxN9qDsy+FqwuRrbkf2jR3md+TPXgde40i1nNKeRE3DOB1HWbkq2E12pLVRTMaSjDqXmYsfUYjbfSR2/H7+UnoEgGnwJ+rmYAbeJ5vqUaMBngILLYFhUqb8BbVTf/Ng/q+mi8kpbpSCkKBC7n3VWT+P6mbnRimzxwReAY= 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: ee2311b9-2fed-4ff7-3c13-08d59db0c6f2 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:23:48.1124 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0871 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 4856cf83f9e4..d2e3f8b73849 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c @@ -9758,11 +9758,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