wifi: mac80211: take lock before setting vif links
authorBenjamin Berg <benjamin.berg@intel.com>
Thu, 8 Jun 2023 13:36:02 +0000 (16:36 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Jun 2023 14:00:59 +0000 (16:00 +0200)
commite83bc93886276b7689c229d9c9563b3793bb70bd
treeccb2e736a1c8204c091e8eb75301ed67d47e6b16
parent170ceadf4a57d2e7d259e85366d37874bff1ea65
wifi: mac80211: take lock before setting vif links

[ Upstream commit 15846f95ab01b71fdb1cef8df73680aad41edf70 ]

ieee80211_vif_set_links requires the sdata->local->mtx lock to be held.
Add the appropriate locking around the calls in both the link add and
remove handlers.

This causes a warning when e.g. ieee80211_link_release_channel is called
via ieee80211_link_stop from ieee80211_vif_update_links.

Fixes: 0d8c4a3c8688 ("wifi: mac80211: implement add/del interface link callbacks")
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230608163202.fa0c6597fdad.I83dd70359f6cda30f86df8418d929c2064cf4995@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/mac80211/cfg.c