linux-stable/net/wireless
Léo Lam e904e81fd3 wifi: nl80211: fix deadlock in nl80211_set_cqm_rssi (6.6.x)
Commit 008afb9f3d57 ("wifi: cfg80211: fix CQM for non-range use"
backported to 6.6.x) causes nl80211_set_cqm_rssi not to release the
wdev lock in some of the error paths.

Of course, the ensuing deadlock causes userland network managers to
break pretty badly, and on typical systems this also causes lockups on
on suspend, poweroff and reboot. See [1], [2], [3] for example reports.

The upstream commit 7e7efdda6a ("wifi: cfg80211: fix CQM for non-range
use"), committed in November 2023, is completely fine because there was
another commit in August 2023 that removed the wdev lock:
see commit 076fc8775d ("wifi: cfg80211: remove wdev mutex").

The reason things broke in 6.6.5 is that commit 4338058f6009 was applied
without also applying 076fc8775d.

Commit 076fc8775d ("wifi: cfg80211: remove wdev mutex") is a rather
large commit; adjusting the error handling (which is what this commit does)
yields a much simpler patch and was tested to work properly.

Fix the deadlock by releasing the lock before returning.

[1] https://bugzilla.kernel.org/show_bug.cgi?id=218247
[2] https://bbs.archlinux.org/viewtopic.php?id=290976
[3] https://lore.kernel.org/all/87sf4belmm.fsf@turtle.gmx.de/

Link: https://lore.kernel.org/stable/e374bb16-5b13-44cc-b11a-2f4eefb1ecf5@manjaro.org/
Fixes: 008afb9f3d57 ("wifi: cfg80211: fix CQM for non-range use")
Tested-by: "Léo Lam" <leo@leolam.fr>
Tested-by: Philip Müller <philm@manjaro.org>
Cc: stable@vger.kernel.org
Cc: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: "Léo Lam" <leo@leolam.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-01-05 15:19:44 +01:00
..
certs wifi: cfg80211: fix certs build to not depend on file order 2024-01-01 12:42:39 +00:00
.gitignore
ap.c wifi: nl80211: add MLO_LINK_ID to CMD_STOP_AP event 2023-02-14 12:09:17 +01:00
chan.c wifi: cfg80211: move puncturing bitmap validation from mac80211 2023-02-14 12:09:18 +01:00
core.c wifi: cfg80211: add flush functions for wiphy work 2023-11-20 11:58:54 +01:00
core.h wifi: cfg80211: fix CQM for non-range use 2024-01-05 15:19:44 +01:00
debugfs.c wifi: cfg80211: debugfs: fix return type in ht40allow_map_read() 2022-08-25 10:04:46 +02:00
debugfs.h
ethtool.c wifi: cfg80211: use strscpy to replace strlcpy 2022-07-15 11:43:12 +02:00
ibss.c wifi: cfg80211: remove support for static WEP 2023-01-18 17:31:44 +01:00
Kconfig cfg80211: select CONFIG_CRC32 2021-01-05 15:50:36 -08:00
lib80211.c lib80211: Remove unused macro DRV_NAME 2020-09-18 11:53:00 +02:00
lib80211_crypt_ccmp.c wifi: use struct_group to copy addresses 2022-09-03 16:40:06 +02:00
lib80211_crypt_tkip.c mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
lib80211_crypt_wep.c mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
Makefile cfg80211: fix CONFIG_CFG80211_EXTRA_REGDB_KEYDIR typo 2022-03-01 14:10:14 +01:00
mesh.c wifi: cfg80211: do some rework towards MLO link APIs 2022-06-20 12:54:58 +02:00
mlme.c wifi: cfg80211: fix assoc response warning on failed links 2023-10-23 13:25:30 +02:00
nl80211.c wifi: nl80211: fix deadlock in nl80211_set_cqm_rssi (6.6.x) 2024-01-05 15:19:44 +01:00
nl80211.h wifi: nl80211: Remove unused declaration nl80211_pmsr_dump_results() 2023-08-22 21:40:40 +02:00
ocb.c wifi: cfg80211: ocb: don't leave if not joined 2023-08-22 21:40:39 +02:00
of.c
pmsr.c wifi: cfg80211: Annotate struct cfg80211_pmsr_request with __counted_by 2023-08-22 13:18:16 +02:00
radiotap.c mac80211: Use flex-array for radiotap header bitmap 2021-08-13 09:58:25 +02:00
rdev-ops.h wifi: cfg80211: add inform_bss op to update BSS 2023-06-19 12:05:28 +02:00
reg.c wifi: nl80211/reg: add no-EHT regulatory flag 2023-06-21 14:01:29 +02:00
reg.h cfg80211: avoid holding the RTNL when calling the driver 2021-01-26 11:55:50 +01:00
scan.c wifi: cfg80211: fix off-by-one in element defrag 2023-11-20 11:58:55 +01:00
sme.c wifi: cfg80211/nl80211: Add support to indicate STA MLD setup links removal 2023-06-19 12:08:40 +02:00
sysfs.c wifi: cfg80211: add flush functions for wiphy work 2023-11-20 11:58:54 +01:00
sysfs.h
trace.c
trace.h wifi: cfg80211/nl80211: Add support to indicate STA MLD setup links removal 2023-06-19 12:08:40 +02:00
util.c wifi: cfg80211: fix receiving mesh packets without RFC1042 header 2023-07-12 18:03:40 -07:00
wext-compat.c wifi: cfg80211: remove support for static WEP 2023-01-18 17:31:44 +01:00
wext-compat.h wifi: cfg80211: Avoid clashing function prototypes 2022-11-16 11:31:47 +02:00
wext-core.c wifi: wext-core: Fix -Wstringop-overflow warning in ioctl_standard_iw_point() 2023-06-19 12:05:27 +02:00
wext-priv.c
wext-proc.c
wext-sme.c wifi: cfg80211: wext: hold wiphy lock in siwgenie 2023-06-07 19:53:11 +02:00
wext-spy.c wireless: wext-spy: Fix out-of-bounds warning 2021-06-23 10:57:17 +02:00