]> git.ipfire.org Git - people/arne_f/kernel.git/commitdiff
mac80211: rx: avoid RCU list traversal under mutex
authorMadhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
Sun, 23 Feb 2020 14:33:02 +0000 (20:03 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Mar 2020 09:54:24 +0000 (10:54 +0100)
[ Upstream commit 253216ffb2a002a682c6f68bd3adff5b98b71de8 ]

local->sta_mtx is held in __ieee80211_check_fast_rx_iface().
No need to use list_for_each_entry_rcu() as it also requires
a cond argument to avoid false lockdep warnings when not used in
RCU read-side section (with CONFIG_PROVE_RCU_LIST).
Therefore use list_for_each_entry();

Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
Link: https://lore.kernel.org/r/20200223143302.15390-1-madhuparnabhowmik10@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/mac80211/rx.c

index 31000622376dfe72f2a2ad73342d4d9337f04f84..7c92b1471c34c5552c31bce7d064acd6286d37a0 100644 (file)
@@ -3862,7 +3862,7 @@ void __ieee80211_check_fast_rx_iface(struct ieee80211_sub_if_data *sdata)
 
        lockdep_assert_held(&local->sta_mtx);
 
-       list_for_each_entry_rcu(sta, &local->sta_list, list) {
+       list_for_each_entry(sta, &local->sta_list, list) {
                if (sdata != sta->sdata &&
                    (!sta->sdata->bss || sta->sdata->bss != sdata->bss))
                        continue;