This is a note to let you know that I've just added the patch titled wifi: nl80211: relax wdev mutex check in wdev_chandef() to the 5.19-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: wifi-nl80211-relax-wdev-mutex-check-in-wdev_chandef.patch and it can be found in the queue-5.19 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 31177127e067eb73d5ca46ce32a410e41333d42f Mon Sep 17 00:00:00 2001 From: Johannes Berg <johannes.berg@xxxxxxxxx> Date: Mon, 27 Jun 2022 12:49:03 +0200 Subject: wifi: nl80211: relax wdev mutex check in wdev_chandef() From: Johannes Berg <johannes.berg@xxxxxxxxx> commit 31177127e067eb73d5ca46ce32a410e41333d42f upstream. In many cases we might get here from driver code that's not really set up to care about the locking, and for the non-MLO cases we really don't care so much about it. So relax the checking here for now, perhaps we should even remove it completely since we might not really care if we point to an invalid link's chandef and can require the caller to check the link validity first. Fixes: 7b0a0e3c3a88 ("wifi: cfg80211: do some rework towards MLO link APIs") Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- net/wireless/chan.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) --- a/net/wireless/chan.c +++ b/net/wireless/chan.c @@ -1433,7 +1433,17 @@ EXPORT_SYMBOL(cfg80211_any_usable_channe struct cfg80211_chan_def *wdev_chandef(struct wireless_dev *wdev, unsigned int link_id) { - ASSERT_WDEV_LOCK(wdev); + /* + * We need to sort out the locking here - in some cases + * where we get here we really just don't care (yet) + * about the valid links, but in others we do. But we + * get here with various driver cases, so we cannot + * easily require the wdev mutex. + */ + if (link_id || wdev->valid_links & BIT(0)) { + ASSERT_WDEV_LOCK(wdev); + WARN_ON(!(wdev->valid_links & BIT(link_id))); + } switch (wdev->iftype) { case NL80211_IFTYPE_MESH_POINT: Patches currently in stable-queue which might be from johannes.berg@xxxxxxxxx are queue-5.19/wifi-cfg80211-remove-chandef-check-in-cfg80211_cac_event.patch queue-5.19/wifi-cfg80211-do-some-rework-towards-mlo-link-apis.patch queue-5.19/wifi-mac80211-reject-wep-or-pairwise-keys-with-key-i.patch queue-5.19/wifi-mac80211_hwsim-use-32-bit-skb-cookie.patch queue-5.19/wifi-mac80211_hwsim-add-back-erroneously-removed-cast.patch queue-5.19/wifi-mac80211-set-sta-deflink-addresses.patch queue-5.19/wifi-mac80211-move-some-future-per-link-data-to-bss_.patch queue-5.19/wifi-mac80211_hwsim-fix-race-condition-in-pending-packet.patch queue-5.19/wifi-cfg80211-handle-ibss-in-channel-switch.patch queue-5.19/wifi-nl80211-acquire-wdev-mutex-for-dump_survey.patch queue-5.19/wifi-nl80211-hold-wdev-mutex-for-tid-config.patch queue-5.19/wifi-nl80211-acquire-wdev-mutex-earlier-in-start_ap.patch queue-5.19/wifi-nl80211-relax-wdev-mutex-check-in-wdev_chandef.patch