提交 24480b37 编写于 作者: J Johannes Berg 提交者: Zheng Zengkai

iwlwifi: mvm: fix access to BSS elements

stable inclusion
from stable-5.10.67
commit 4ed6510e0559510ac967b42eb019c0753e435c43
bugzilla: 182619 https://gitee.com/openeuler/kernel/issues/I4EWO7

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=4ed6510e0559510ac967b42eb019c0753e435c43

--------------------------------

[ Upstream commit 6c608cd6 ]

BSS elements are protected using RCU, so we need to use
RCU properly to access them, fix that.
Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210805130823.fd8b5791ab44.Iba26800a6301078d3782fb249c476dd8ac2bf3c6@changeidSigned-off-by: NLuca Coelho <luciano.coelho@intel.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 8c30ff88
...@@ -3029,16 +3029,20 @@ static void iwl_mvm_check_he_obss_narrow_bw_ru_iter(struct wiphy *wiphy, ...@@ -3029,16 +3029,20 @@ static void iwl_mvm_check_he_obss_narrow_bw_ru_iter(struct wiphy *wiphy,
void *_data) void *_data)
{ {
struct iwl_mvm_he_obss_narrow_bw_ru_data *data = _data; struct iwl_mvm_he_obss_narrow_bw_ru_data *data = _data;
const struct cfg80211_bss_ies *ies;
const struct element *elem; const struct element *elem;
elem = cfg80211_find_elem(WLAN_EID_EXT_CAPABILITY, bss->ies->data, rcu_read_lock();
bss->ies->len); ies = rcu_dereference(bss->ies);
elem = cfg80211_find_elem(WLAN_EID_EXT_CAPABILITY, ies->data,
ies->len);
if (!elem || elem->datalen < 10 || if (!elem || elem->datalen < 10 ||
!(elem->data[10] & !(elem->data[10] &
WLAN_EXT_CAPA10_OBSS_NARROW_BW_RU_TOLERANCE_SUPPORT)) { WLAN_EXT_CAPA10_OBSS_NARROW_BW_RU_TOLERANCE_SUPPORT)) {
data->tolerated = false; data->tolerated = false;
} }
rcu_read_unlock();
} }
static void iwl_mvm_check_he_obss_narrow_bw_ru(struct ieee80211_hw *hw, static void iwl_mvm_check_he_obss_narrow_bw_ru(struct ieee80211_hw *hw,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册