wifi: mac80211: relax RCU check in for_each_vif_active_link()
authorJohannes Berg <johannes.berg@intel.com>
Wed, 20 Sep 2023 18:25:15 +0000 (21:25 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 25 Sep 2023 07:12:33 +0000 (09:12 +0200)
To iterate the vif links we don't necessarily need to be in an
RCU critical section, it's also possible to hold the sdata/wdev
mutex. Annotate for_each_vif_active_link() accordingly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230920211508.858921bd2860.I01f456be8ce2a4fbd15e0d44302e2f7d72e91987@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/net/mac80211.h

index 0f6390865fe7a9ea8c6162c58feb346119d88676..5b477c35e03babc4e0c535c2cdd12707d5221df5 100644 (file)
@@ -1942,7 +1942,7 @@ static inline bool ieee80211_vif_is_mld(const struct ieee80211_vif *vif)
        for (link_id = 0; link_id < ARRAY_SIZE((vif)->link_conf); link_id++)    \
                if ((!(vif)->active_links ||                                    \
                     (vif)->active_links & BIT(link_id)) &&                     \
-                   (link = rcu_dereference((vif)->link_conf[link_id])))
+                   (link = link_conf_dereference_check(vif, link_id)))
 
 static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
 {