summaryrefslogtreecommitdiff
path: root/net/mac80211/rx.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2022-06-17 22:36:37 +0200
committerJohannes Berg <johannes.berg@intel.com>2022-07-15 11:43:14 +0200
commitd8675a63518c6148827838058feb7f18403faed1 (patch)
treefbdee52aa9f31da2b33ad5804cc4ea76a9a82a24 /net/mac80211/rx.c
parent3d1cc7cdf2e848181398837fe158bf0850d29ee6 (diff)
wifi: mac80211: RCU-ify link/link_conf pointers
Since links can be added and removed dynamically, we need to somehow protect the sdata->link[] and vif->link_conf[] array pointers from disappearing when accessing them without locks. RCU-ify the pointers to achieve this, which requires quite a bit of rework. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r--net/mac80211/rx.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index b7dff3ef9748..c70156e49d0d 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -4156,9 +4156,13 @@ static bool ieee80211_is_our_addr(struct ieee80211_sub_if_data *sdata,
return false;
for (link_id = 0; link_id < ARRAY_SIZE(sdata->vif.link_conf); link_id++) {
- if (!sdata->vif.link_conf[link_id])
+ struct ieee80211_bss_conf *conf;
+
+ conf = rcu_dereference(sdata->vif.link_conf[link_id]);
+
+ if (!conf)
continue;
- if (ether_addr_equal(sdata->vif.link_conf[link_id]->addr, addr)) {
+ if (ether_addr_equal(conf->addr, addr)) {
if (out_link_id)
*out_link_id = link_id;
return true;