Skip to content

Commit a59d555

Browse files
committed
mac80211_hwsim: fix RCU protected chanctx access
We need to RCU protect the chanctx_conf access, so do that. Fixes: 585625c ("mac80211_hwsim: check TX and STA bandwidth") Signed-off-by: Johannes Berg <johannes.berg@intel.com> Link: https://lore.kernel.org/r/20220505230421.fb8055c081a2.Ic6da3307c77a909bd61a0ea25dc2a4b08fe1b03f@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent c7e34c1 commit a59d555

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

drivers/net/wireless/mac80211_hwsim.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2202,11 +2202,14 @@ mac80211_hwsim_sta_rc_update(struct ieee80211_hw *hw,
22022202
if (!data->use_chanctx) {
22032203
confbw = data->bw;
22042204
} else {
2205-
struct ieee80211_chanctx_conf *chanctx_conf =
2206-
rcu_dereference(vif->chanctx_conf);
2205+
struct ieee80211_chanctx_conf *chanctx_conf;
2206+
2207+
rcu_read_lock();
2208+
chanctx_conf = rcu_dereference(vif->chanctx_conf);
22072209

22082210
if (!WARN_ON(!chanctx_conf))
22092211
confbw = chanctx_conf->def.width;
2212+
rcu_read_unlock();
22102213
}
22112214

22122215
WARN(bw > hwsim_get_chanwidth(confbw),

0 commit comments

Comments
 (0)