Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2349181pxb; Mon, 20 Sep 2021 19:42:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzzuhKYZWAIHptHxzSMLTrA5I1Gyf3BKHuOHIPJD1wR8abyQJInt+UY8pW6qUquYBx9qZ+ X-Received: by 2002:a17:906:2f10:: with SMTP id v16mr10422941eji.434.1632192151390; Mon, 20 Sep 2021 19:42:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632192151; cv=none; d=google.com; s=arc-20160816; b=Z6TxU1rjrc06/Lj3ir2RehuGXJ+9dhgymrw1hFr7+Cdc6Y0gYRRtRwuDRZHe7scIwB mueJ4ZBsx9VrafOGTTqzEt3FI1WSw5USEjPbwI1Wy6tyg+AVMYPgPHfTOOgLNDVkFY2u GoRNdh9WFAMbV1IFIhcM+6OMJLz7nBRJVU/yI4K6/FhtVmccxLIMl7iQsjhY45HW5Ymy ZRYHKFoGMgL5ADT8j0af6Ez6j75QXwlItu2FAwvL6BhId6Ms4XXyEgcW460SchcA+/UI kMdBdQ1jb1YcxLuvJqKNJykg5anfMCKIkz6uTQfehIFRAii0JIIhS+IOozpohf8WFEpO nWcg== 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=sDeU6tlJyO4FA+taDZDWrs6Ofa1JSDY7Q/dLCmxd6ag=; b=vCDo4P55k8zK2N/4bDstTQW0h1bpecLzTEk5tWUPLjBJ+OI0FldsT/F3lbplfEJLsE p8LA8T22PI35B1PLW3jqK4FqnDmiwxTm17ILXv+FHpvi4/rXFFuvNHzsyEbGC9VU0P94 5oXwpMfSpI9XvOyC+Y748Pu7tOPRlZ42rv+cZzpKct2vjHlNMONryJadTPrOsz3YVZeW QLPjyYM55fbhJc29RlpubA/GKIekSQp3yxun0Vwj7fcblYxx5IKHBs8AsxPSbQCh2yOc jSZkyzM+Ey7N6zzgvtSKe5yBHrFbbq5xBMJOHgahKMj7RzZrPFEZmckfLicxp/ZVgecy Ug6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="YlIOe7/v"; 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 p15si23421779edj.97.2021.09.20.19.42.08; Mon, 20 Sep 2021 19:42:31 -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="YlIOe7/v"; 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 S1351570AbhITSTq (ORCPT + 99 others); Mon, 20 Sep 2021 14:19:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:35522 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376524AbhITSMt (ORCPT ); Mon, 20 Sep 2021 14:12:49 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9B01B63285; Mon, 20 Sep 2021 17:20:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158458; bh=tKk3M5hdu0SivRmHrP4r5yAGD7NV+BEosnEsay9gu6c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YlIOe7/v8vWCzWIj1Fmqy/nS2K7xf0RUCW7Dai7ty3/JmQ9Ru0qzBf8WTD+UzriqO obouw69Kbjt+5QQOLb8VBKdWjHMLeaXD3tSXY4pNk2QHJ4+ofkKaU3IeefYgoHwf7d s5uTG6pO/NSpU9S4lcQvRHiVW8ojb0RMGScOcxXY= 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.4 166/260] iwlwifi: mvm: fix access to BSS elements Date: Mon, 20 Sep 2021 18:43:04 +0200 Message-Id: <20210920163936.726479314@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163931.123590023@linuxfoundation.org> References: <20210920163931.123590023@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 09b1a6beee77..081cbc9ec736 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -2970,16 +2970,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