From patchwork Wed Jan 15 13:55:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216642 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2579DC33CB3 for ; Wed, 15 Jan 2020 13:55:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DF035222C3 for ; Wed, 15 Jan 2020 13:55:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="IP5fm4u3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730016AbgAONzf (ORCPT ); Wed, 15 Jan 2020 08:55:35 -0500 Received: from mail-eopbgr770047.outbound.protection.outlook.com ([40.107.77.47]:48566 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729955AbgAONze (ORCPT ); Wed, 15 Jan 2020 08:55:34 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HM7GncxmHJhiXvhtLMaF2WVPHimMXlhaI/8CfND1T67HtWvqJoGDHxBTjKAQWmL0VJAANBhnv7zd/Mx/bgb9WzbOE42tMEn3pYbLisoKNsHoz77f6l85RtxLAxK6XD0/kbj27M51drny1Y8G8yJYybLk/KGznXSAZw6862MJnLgzHx5iW5ORhNMrgNn+jd+L4fpfzT9bWzs/g9iPURNoKteK03kHoIf0F2d2NDy7k3ODboGAcA9auzDnhBJ03motKVj3e8sYE9rZp7sXnM5WMogHBv4BseSBtgfGtSKWXbis9wd1A8gHe2SV74HxBQYb/JA85teQBICf2qPv0bZu5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=S58a9nBVLutMsEJZPV8bHoCpGXQyMjCyT50cVLTOSZ8=; b=LytiwQ0WnQ3aMLBlk5J0xVmUkukhMtSI0HIEPxxKVbC+bz3GCMaaZAFGt8X5PMHz1KFti/DwFHaFM35DFla0zu1sjrbqFDP2ujgL4bXcEtsZWmquyjyuu7WaDB5dCfQtCU2Su6I4xJb1iNSWx2TSElRwq4wwp+YdMDDth2zMuqEHy+HFKIzqtJNwXQiPSb+jC4IjLMPKOzh3OjQXH/yUIuk9rTYnDk37ze9pQh9l5o7UR67/KsLogPDXQ1L2ZoilNmw6s3kGPniPMJwqTg1ovqYZbzEhlMUT3UPcB/WiRobVNI2F73jg3jCz5mDeTqM68Vlpttb0wgoyla7scSP0lA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=S58a9nBVLutMsEJZPV8bHoCpGXQyMjCyT50cVLTOSZ8=; b=IP5fm4u34uT+JdFfSsJqyoYe+ruNjaVKiUKH47+8e8wZRlyCbJk79OPz0lx4nZnuFEzN8zH1OZEUqur6Mq1og8+b8bgSA5D7etr73mQpYG8W2ukibjE+HGf6K0wO1XPgsg+KWJYbox2227Mnn4m4XfdcL3v2IdG8Sa/6fOZUaIw= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3661.namprd11.prod.outlook.com (20.178.252.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18; Wed, 15 Jan 2020 13:55:25 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:55:25 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:55:11 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 48/65] staging: wfx: fix RCU usage Thread-Topic: [PATCH v2 48/65] staging: wfx: fix RCU usage Thread-Index: AQHVy6toAXQ1JWeWU06vV4WjT0TLSw== Date: Wed, 15 Jan 2020 13:55:12 +0000 Message-ID: <20200115135338.14374-49-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9789353e-7c4a-4ae6-1977-08d799c28a6b x-ms-traffictypediagnostic: MN2PR11MB3661: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:390; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(396003)(136003)(346002)(366004)(199004)(189003)(8886007)(6486002)(316002)(54906003)(71200400001)(36756003)(6506007)(66476007)(66446008)(66946007)(110136005)(8676002)(81166006)(81156014)(478600001)(86362001)(2616005)(4326008)(66574012)(2906002)(107886003)(1076003)(16526019)(186003)(85202003)(5660300002)(6512007)(52116002)(64756008)(66556008)(85182001)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3661; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: pNuT7HyEhSwa2PfBEQdtUe6p9koYyyWtEpASn+sJOgIOUMWix8TKPchbJqilopLPT1yy5Ct46GZdttuPrFHyKG5mACGHdT9boYACpfojl+1vwKRPqS8600MoazBXnvkkpZogqIlXy6miFY9DwGmN2MFKlNdKGf4gUGezPVYUQLInVUQ+4bBpV/ULO2M/N/ADpd6o+HgBxukDUWIyuU+k5MYj5RnVNZnNaUmYWEKAFP+QgpJMq4O3Yr3pasR091YhEXCIk6lKpAisrAQ4OlVrLsbsecIt5DzdKR8jdiv0wBsXhpHDtVx5twZ7T3TXAY+btjHWmIGKggBR/UQbF9dLRKiMKJCM4EtTPF0LsAT5xxxAFwPVgNuH59Z7LDzHpKy0ODc9U93jMjLPJ9q4n8vwrTwY2yCD0XqKAW0eEGaREqIrFOqrFpLQPoceJ9Abq1gD Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9789353e-7c4a-4ae6-1977-08d799c28a6b X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:55:12.3023 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: IKiWCp7PdyIs6DS/6TjL7DsCgtvC7UTF+EqS7QNsMz/I+aL9IDBY1TRQLcumDNbwosqYlbC8x2BgUx04oB252Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3661 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Indeed, sta was used after call to rcu_unlock() Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 1c10ebd11944..cc72877a090f 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -690,10 +690,9 @@ static void wfx_join_finalize(struct wfx_vif *wvif, struct ieee80211_sta *sta = NULL; wvif->beacon_int = info->beacon_int; - rcu_read_lock(); + rcu_read_lock(); // protect sta if (info->bssid && !info->ibss_joined) sta = ieee80211_find_sta(wvif->vif, info->bssid); - rcu_read_unlock(); if (sta) wvif->bss_params.operational_rate_set = wfx_rate_mask_to_hw(wvif->wdev, sta->supp_rates[wvif->channel->band]); @@ -712,6 +711,7 @@ static void wfx_join_finalize(struct wfx_vif *wvif, wvif->bss_params.aid = info->aid; hif_set_association_mode(wvif, info, sta ? &sta->ht_cap : NULL); + rcu_read_unlock(); if (!info->ibss_joined) { hif_keep_alive_period(wvif, 30 /* sec */);