diff options
author | Johannes Berg <johannes.berg@intel.com> | 2021-05-17 17:03:23 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2021-06-08 12:33:07 +0300 |
commit | d5befb224edbe53056c2c18999d630dafb4a08b9 (patch) | |
tree | d02b071713fea8c3df26ce8ac33dd05c9695b9d1 /net/wireless/core.c | |
parent | bddc0c411a45d3718ac535a070f349be8eca8d48 (diff) | |
download | linux-d5befb224edbe53056c2c18999d630dafb4a08b9.tar.xz |
mac80211: fix deadlock in AP/VLAN handling
Syzbot reports that when you have AP_VLAN interfaces that are up
and close the AP interface they belong to, we get a deadlock. No
surprise - since we dev_close() them with the wiphy mutex held,
which goes back into the netdev notifier in cfg80211 and tries to
acquire the wiphy mutex there.
To fix this, we need to do two things:
1) prevent changing iftype while AP_VLANs are up, we can't
easily fix this case since cfg80211 already calls us with
the wiphy mutex held, but change_interface() is relatively
rare in drivers anyway, so changing iftype isn't used much
(and userspace has to fall back to down/change/up anyway)
2) pull the dev_close() loop over VLANs out of the wiphy mutex
section in the normal stop case
Cc: stable@vger.kernel.org
Reported-by: syzbot+452ea4fbbef700ff0a56@syzkaller.appspotmail.com
Fixes: a05829a7222e ("cfg80211: avoid holding the RTNL when calling the driver")
Link: https://lore.kernel.org/r/20210517160322.9b8f356c0222.I392cb0e2fa5a1a94cf2e637555d702c7e512c1ff@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/core.c')
0 files changed, 0 insertions, 0 deletions