diff options
author | Johannes Berg <johannes.berg@intel.com> | 2024-08-27 09:49:40 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2024-08-28 12:39:29 +0200 |
commit | ac35180032fbc5d80b29af00ba4881815ceefcb6 (patch) | |
tree | 3e46578a45a5fa4c5baa02836e23ad7d8d22eeda /net/mac80211/util.c | |
parent | d07e1f5c745058d1805e7d8042b9a326b120cb6e (diff) |
wifi: mac80211: fix RCU list iterations
There are a number of places where RCU list iteration is
used, but that aren't (always) called with RCU held. Use
just list_for_each_entry() in most, and annotate iface
iteration with the required locks.
Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20240827094939.ed8ac0b2f897.I8443c9c3c0f8051841353491dae758021b53115e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r-- | net/mac80211/util.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 830f736f9c13..ba61de90ba35 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -751,7 +751,9 @@ static void __iterate_interfaces(struct ieee80211_local *local, struct ieee80211_sub_if_data *sdata; bool active_only = iter_flags & IEEE80211_IFACE_ITER_ACTIVE; - list_for_each_entry_rcu(sdata, &local->interfaces, list) { + list_for_each_entry_rcu(sdata, &local->interfaces, list, + lockdep_is_held(&local->iflist_mtx) || + lockdep_is_held(&local->hw.wiphy->mtx)) { switch (sdata->vif.type) { case NL80211_IFTYPE_MONITOR: if (!(sdata->u.mntr.flags & MONITOR_FLAG_ACTIVE)) |