]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit - net/wireless/reg.h
cfg80211: restore regulatory without calling userspace
authorJohannes Berg <johannes.berg@intel.com>
Tue, 5 Feb 2019 20:08:29 +0000 (21:08 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 11 Feb 2019 14:46:29 +0000 (15:46 +0100)
commite646a0257b64dbef9d168e0f90daafa3fc1a83af
tree305a86576873ac7e682a2f2639c760731be6026c
parent61edb116cab9bf7d623e31bf7455a82bc042c087
cfg80211: restore regulatory without calling userspace

Jouni reports that in some cases it is possible that getting
disconnected (or stopping AP, after previous patches) results
in further operations hitting the window within the regulatory
core restoring the regdomain to the defaults. The reason for
this is that we have to call out to CRDA or otherwise do some
asynchronous work, and thus can't do the restore atomically.

However, we've previously seen all the data we need to do the
restore, so we can hang on to that data and use it later for
the restore. This makes the whole thing happen within a single
locked section and thus atomic.

However, we can't *always* do this - there are unfortunately
cases where the restore needs to re-request, because this is
also used (abused?) as an error recovery process, so make the
new behaviour optional and only use it when doing a regular
restore as described above.

Reported-by: Jouni Malinen <j@w1.fi>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/reg.c
net/wireless/reg.h