wifi: cfg80211: hold wiphy mutex for send_interface
authorJohannes Berg <johannes.berg@intel.com>
Wed, 15 Nov 2023 12:06:16 +0000 (13:06 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 24 Nov 2023 17:30:48 +0000 (18:30 +0100)
commit103317670e6bf2542309db28d52444a83d84ed28
tree807aec1a2d0e496e16639fcf9422931227eccc4d
parent8e2f6f2366219b3304b227bdd2f04b64c92e3e12
wifi: cfg80211: hold wiphy mutex for send_interface

Given all the locking rework in mac80211, we pretty much
need to get into the driver with the wiphy mutex held in
all callbacks. This is already mostly the case, but as
Johan reported, in the get_txpower it may not be true.

Lock the wiphy mutex around nl80211_send_iface(), then
is also around callers of nl80211_notify_iface(). This
is easy to do, fixes the problem, and aligns the locking
between various calls to it in different parts of the
code of cfg80211.

Fixes: 0e8185ce1dde ("wifi: mac80211: check wiphy mutex in ops")
Reported-by: Johan Hovold <johan@kernel.org>
Closes: https://lore.kernel.org/r/ZVOXX6qg4vXEx8dX@hovoldconsulting.com
Tested-by: Johan Hovold <johan+linaro@kernel.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/core.c
net/wireless/nl80211.c