mirror-linux/net/wireless
Johannes Berg c797498e86 wifi: cfg80211: fix cqm_config access race
[ Upstream commit 37c20b2eff ]

Max Schulze reports crashes with brcmfmac. The reason seems
to be a race between userspace removing the CQM config and
the driver calling cfg80211_cqm_rssi_notify(), where if the
data is freed while cfg80211_cqm_rssi_notify() runs it will
crash since it assumes wdev->cqm_config is set. This can't
be fixed with a simple non-NULL check since there's nothing
we can do for locking easily, so use RCU instead to protect
the pointer, but that requires pulling the updates out into
an asynchronous worker so they can sleep and call back into
the driver.

Since we need to change the free anyway, also change it to
go back to the old settings if changing the settings fails.

Reported-and-tested-by: Max Schulze <max.schulze@online.de>
Closes: https://lore.kernel.org/r/ac96309a-8d8d-4435-36e6-6d152eb31876@online.de
Fixes: 4a4b816950 ("cfg80211: Accept multiple RSSI thresholds for CQM")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-10-10 22:00:40 +02:00
..
certs
.gitignore
Kconfig
Makefile
ap.c
chan.c
core.c wifi: cfg80211: fix cqm_config access race 2023-10-10 22:00:40 +02:00
core.h wifi: cfg80211: fix cqm_config access race 2023-10-10 22:00:40 +02:00
debugfs.c
debugfs.h
ethtool.c
ibss.c
lib80211.c
lib80211_crypt_ccmp.c
lib80211_crypt_tkip.c
lib80211_crypt_wep.c
mesh.c
mlme.c wifi: cfg80211: reject auth/assoc to AP with our address 2023-09-23 11:11:03 +02:00
nl80211.c wifi: cfg80211: fix cqm_config access race 2023-10-10 22:00:40 +02:00
nl80211.h
ocb.c wifi: cfg80211: ocb: don't leave if not joined 2023-09-23 11:11:03 +02:00
of.c
pmsr.c
radiotap.c
rdev-ops.h wifi: cfg80211: fix link del callback to call correct handler 2023-06-21 16:00:59 +02:00
reg.c wifi: cfg80211: fix regulatory disconnect for non-MLO 2023-07-19 16:22:09 +02:00
reg.h
scan.c wifi: cfg80211: Fix return value in scan logic 2023-08-11 12:08:11 +02:00
sme.c wifi: cfg80211: hold wiphy lock in auto-disconnect 2023-10-10 22:00:39 +02:00
sysfs.c wifi: cfg80211: add a work abstraction with special semantics 2023-10-10 22:00:39 +02:00
sysfs.h
trace.c
trace.h
util.c wifi: cfg80211: remove links only on AP 2023-09-13 09:42:24 +02:00
wext-compat.c
wext-compat.h
wext-core.c wifi: wext-core: Fix -Wstringop-overflow warning in ioctl_standard_iw_point() 2023-07-27 08:50:35 +02:00
wext-priv.c
wext-proc.c
wext-sme.c
wext-spy.c