From: Johannes Berg The wiphy mutex was only required for the cookie counter, but that's been in cfg80211 for a while. The rest is just datapath, so can work under RCU, just need to be careful to handle interface type changes. Signed-off-by: Johannes Berg --- net/mac80211/tx.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 1953ec35c783..46134bda1e8f 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -6600,9 +6600,6 @@ int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev, u32 flags = 0; int err; - /* mutex lock is only needed for incrementing the cookie counter */ - lockdep_assert_wiphy(local->hw.wiphy); - /* Only accept CONTROL_PORT_PROTOCOL configured in CONNECT/ASSOCIATE * or Pre-Authentication */ @@ -6661,6 +6658,14 @@ int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev, * AF_PACKET */ rcu_read_lock(); + + /* do_stop() synchronizes RCU before the interface type can change */ + if (!ieee80211_sdata_running(sdata)) { + dev_kfree_skb(skb); + rcu_read_unlock(); + return -ENETDOWN; + } + err = ieee80211_lookup_ra_sta(sdata, skb, &sta, true); if (err) { dev_kfree_skb(skb); -- 2.55.0