summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyen Dinh Phi <phind.uet@gmail.com>2021-10-27 20:37:22 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-11-26 13:40:41 +0300
commit4e458abbb4a523f1413bfe15c079cf4e24c15b21 (patch)
treeea48c1a07cbb2409ebe18ec4034941490310d406
parentb8615eb8dcdf53e42538ef6999b9dbbae951c089 (diff)
downloadlinux-4e458abbb4a523f1413bfe15c079cf4e24c15b21.tar.xz
cfg80211: call cfg80211_stop_ap when switch from P2P_GO type
commit 563fbefed46ae4c1f70cffb8eb54c02df480b2c2 upstream. If the userspace tools switch from NL80211_IFTYPE_P2P_GO to NL80211_IFTYPE_ADHOC via send_msg(NL80211_CMD_SET_INTERFACE), it does not call the cleanup cfg80211_stop_ap(), this leads to the initialization of in-use data. For example, this path re-init the sdata->assigned_chanctx_list while it is still an element of assigned_vifs list, and makes that linked list corrupt. Signed-off-by: Nguyen Dinh Phi <phind.uet@gmail.com> Reported-by: syzbot+bbf402b783eeb6d908db@syzkaller.appspotmail.com Link: https://lore.kernel.org/r/20211027173722.777287-1-phind.uet@gmail.com Cc: stable@vger.kernel.org Fixes: ac800140c20e ("cfg80211: .stop_ap when interface is going down") Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--net/wireless/util.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/wireless/util.c b/net/wireless/util.c
index bf4dd297a4db..94849702b518 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -1026,6 +1026,7 @@ int cfg80211_change_iface(struct cfg80211_registered_device *rdev,
switch (otype) {
case NL80211_IFTYPE_AP:
+ case NL80211_IFTYPE_P2P_GO:
cfg80211_stop_ap(rdev, dev, true);
break;
case NL80211_IFTYPE_ADHOC: