Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1540902pxb; Thu, 16 Sep 2021 09:32:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxB0Y2jqL6e6H3WwMtZgMCGsHPRRRjF4EjcBV3C+DLIvZZEiTSYhfhfJNZcma60bgT1K/as X-Received: by 2002:a05:6e02:eb2:: with SMTP id u18mr4662527ilj.138.1631809944187; Thu, 16 Sep 2021 09:32:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631809944; cv=none; d=google.com; s=arc-20160816; b=rGzs6W1aaiTqo8P5GKOpwq8GTIqN5hyczqVe1aQSEWrPnXtWdkvCsSTyneojTh0HPU mLZi1rjGBAWxHR/HAsDEdvfB6k9Uzc0EaTGoQe5Bq/QX/oivqqQF0E1ZnC+iexWGpZW0 K6Kkcj54iGcPzkkn6iU8BzQ71qwaWzM3EFMQu1FbbStPd2c88CjKtZoLm0fr6igyckop ZgarMghH8sCRd9UYsIEoEp2f0JfcdJXCX1VCGVRf8yfAk4OtK4DhmDW2XhiovfFcTnTb ou8EMfp8nXsdgQyVRl+RpWwHiwlqYnVoX1atUkjHDasZ+U8ZgNOy5JUSg8QE6yr8Z7+O AqYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/ad2K0YNDqNrbL2FFumYMtPXjODyX2kqqX5dTaEg170=; b=Q84RcuNarxlwuD/sie5WkMaXB+6WIr01veUgwDcfL6TUaUJpBT4qxN0izbppS+4UaP 6PTy+jYL/1kIEqcqeGMA2ofcOfKGWPh6cifkLeawLRqYplb+EeANnTu6/mOyI9SJ1Hoj BYzfG3qJJTRVVHOwg3Vh6CEClFNc899CdcqOHJ+03CHoSqs2VS/vTsFyH6V9SZLZ43l8 gG0c4Adhx+s0KKfQw7fPeR1LciBz31aFop8iG4bJuZ3srquM4d7xF3SOqp61p3CbStAr Ar73zrUGB1sxh0ggfrh9bBB/pAGMSHv9aotDasEwAdxoZ7ffIttCmCrUdX8NEvFeQNXA DZZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ISKcKcAk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c4si2949513iok.10.2021.09.16.09.32.11; Thu, 16 Sep 2021 09:32:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ISKcKcAk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243277AbhIPQaO (ORCPT + 99 others); Thu, 16 Sep 2021 12:30:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:59302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232046AbhIPQVh (ORCPT ); Thu, 16 Sep 2021 12:21:37 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A1A946140B; Thu, 16 Sep 2021 16:15:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808902; bh=Bxemffs1luq8b35EOX38WdqC11UYKbiJRwusEb19A48=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ISKcKcAkf793Y4VtyvykM4eJhHlyowRyhIc6Gvq5za/X+FNhKTXS3u8s/ffOinrrB euH2HzmQNFhulFW18gvh+Sm7S1hLt/sFkrcSlfDHnZT6OC22uDJs9IVHC6lxb0q9hi Zo/Z/4X5n3NHnGDHwFH0itnvIMZrz7mbaCXahFuo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johannes Berg , Luca Coelho , Sasha Levin Subject: [PATCH 5.10 264/306] iwlwifi: mvm: fix access to BSS elements Date: Thu, 16 Sep 2021 18:00:09 +0200 Message-Id: <20210916155803.074173155@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johannes Berg [ Upstream commit 6c608cd6962ebdf84fd3de6d42f88ed64d2f4e1b ] BSS elements are protected using RCU, so we need to use RCU properly to access them, fix that. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210805130823.fd8b5791ab44.Iba26800a6301078d3782fb249c476dd8ac2bf3c6@changeid Signed-off-by: Luca Coelho Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index 9caff70cbd27..6f301ac8cce2 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -3029,16 +3029,20 @@ static void iwl_mvm_check_he_obss_narrow_bw_ru_iter(struct wiphy *wiphy, void *_data) { struct iwl_mvm_he_obss_narrow_bw_ru_data *data = _data; + const struct cfg80211_bss_ies *ies; const struct element *elem; - elem = cfg80211_find_elem(WLAN_EID_EXT_CAPABILITY, bss->ies->data, - bss->ies->len); + rcu_read_lock(); + ies = rcu_dereference(bss->ies); + elem = cfg80211_find_elem(WLAN_EID_EXT_CAPABILITY, ies->data, + ies->len); if (!elem || elem->datalen < 10 || !(elem->data[10] & WLAN_EXT_CAPA10_OBSS_NARROW_BW_RU_TOLERANCE_SUPPORT)) { data->tolerated = false; } + rcu_read_unlock(); } static void iwl_mvm_check_he_obss_narrow_bw_ru(struct ieee80211_hw *hw, -- 2.30.2