[PATCH net] mac80211: fix locking in ieee80211_start_ap error path

Subsystems: mac80211, the rest

STALE1755d

2 messages, 2 authors, 2021-12-20 · open the first message on its own page

[PATCH net] mac80211: fix locking in ieee80211_start_ap error path

From: Johannes Berg <johannes@sipsolutions.net>
Date: 2021-12-20 09:22:52

From: Johannes Berg <redacted>

We need to hold the local->mtx to release the channel context,
as even encoded by the lockdep_assert_held() there. Fix it.

Cc: stable@vger.kernel.org
Fixes: 295b02c4be74 ("mac80211: Add FILS discovery support")
Reported-and-tested-by: syzbot+11c342e5e30e9539cabd@syzkaller.appspotmail.com
Link: https://lore.kernel.org/r/20211220090836.cee3d59a1915.I36bba9b79dc2ff4d57c3c7aa30dff9a003fe8c5c@changeid
Signed-off-by: Johannes Berg <redacted>
---
Jakub/Dave, could you please apply this directly? I have no
other things pending for net at the moment. Thanks!
---
 net/mac80211/cfg.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index bd3d3195097f..2d0dd69f9753 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1264,7 +1264,10 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
 	return 0;
 
 error:
+	mutex_lock(&local->mtx);
 	ieee80211_vif_release_channel(sdata);
+	mutex_unlock(&local->mtx);
+
 	return err;
 }
 
-- 
2.33.1

Re: [PATCH net] mac80211: fix locking in ieee80211_start_ap error path

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-12-20 11:40:12

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller [off-list ref]:

On Mon, 20 Dec 2021 10:22:40 +0100 you wrote:
From: Johannes Berg <redacted>

We need to hold the local->mtx to release the channel context,
as even encoded by the lockdep_assert_held() there. Fix it.

Cc: stable@vger.kernel.org
Fixes: 295b02c4be74 ("mac80211: Add FILS discovery support")
Reported-and-tested-by: syzbot+11c342e5e30e9539cabd@syzkaller.appspotmail.com
Link: https://lore.kernel.org/r/20211220090836.cee3d59a1915.I36bba9b79dc2ff4d57c3c7aa30dff9a003fe8c5c@changeid
Signed-off-by: Johannes Berg <redacted>

[...]
Here is the summary with links:
  - [net] mac80211: fix locking in ieee80211_start_ap error path
    https://git.kernel.org/netdev/net/c/87a270625a89

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help