sst-linux/net/wireless
Miri Korenblit 0272d4af7f wifi: cfg80211: cancel wiphy_work before freeing wiphy
[ Upstream commit 72d520476a2fab6f3489e8388ab524985d6c4b90 ]

A wiphy_work can be queued from the moment the wiphy is allocated and
initialized (i.e. wiphy_new_nm). When a wiphy_work is queued, the
rdev::wiphy_work is getting queued.

If wiphy_free is called before the rdev::wiphy_work had a chance to run,
the wiphy memory will be freed, and then when it eventally gets to run
it'll use invalid memory.

Fix this by canceling the work before freeing the wiphy.

Fixes: a3ee4dc84c4e ("wifi: cfg80211: add a work abstraction with special semantics")
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250306123626.efd1d19f6e07.I48229f96f4067ef73f5b87302335e2fd750136c9@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-03-28 21:58:48 +01:00
..
certs
.gitignore
ap.c
chan.c
core.c wifi: cfg80211: cancel wiphy_work before freeing wiphy 2025-03-28 21:58:48 +01:00
core.h Revert "wifi: cfg80211: check wiphy mutex is held for wdev mutex" 2024-09-30 16:23:55 +02:00
debugfs.c
debugfs.h
ethtool.c
ibss.c
Kconfig
lib80211_crypt_ccmp.c
lib80211_crypt_tkip.c
lib80211_crypt_wep.c
lib80211.c
Makefile
mesh.c
mlme.c
nl80211.c wifi: nl80211: reject cooked mode if it is set along with other flags 2025-03-13 12:53:14 +01:00
nl80211.h
ocb.c
of.c
pmsr.c wifi: cfg80211: pmsr: use correct nla_get_uX functions 2024-06-21 14:35:31 +02:00
radiotap.c
rdev-ops.h wifi: cfg80211: fix 6 GHz scan request building 2024-07-25 09:49:09 +02:00
reg.c wifi: cfg80211: regulatory: improve invalid hints checking 2025-03-13 12:53:14 +01:00
reg.h
scan.c wifi: cfg80211: adjust allocation of colocated AP data 2025-02-21 13:49:05 +01:00
sme.c wifi: cfg80211: fix two more possible UBSAN-detected off-by-one errors 2024-10-17 15:20:41 +02:00
sysfs.c wifi: cfg80211: fully move wiphy work to unbound workqueue 2024-06-21 14:35:31 +02:00
sysfs.h
trace.c
trace.h wifi: cfg80211: fix the order of arguments for trace events of the tx_rx_evt class 2024-06-12 11:02:58 +02:00
util.c wifi: cfg80211: fix receiving mesh packets without RFC1042 header 2024-08-29 17:30:55 +02:00
wext-compat.c
wext-compat.h
wext-core.c
wext-priv.c
wext-proc.c
wext-sme.c
wext-spy.c