Skip to content

Commit 7b97b57

Browse files
phi-nguyendpgregkh
authored andcommitted
cfg80211: call cfg80211_stop_ap when switch from P2P_GO type
commit 563fbef 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: ac80014 ("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>
1 parent 1ab2978 commit 7b97b57

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎net/wireless/util.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,6 +1044,7 @@ int cfg80211_change_iface(struct cfg80211_registered_device *rdev,
10441044

10451045
switch (otype) {
10461046
case NL80211_IFTYPE_AP:
1047+
case NL80211_IFTYPE_P2P_GO:
10471048
cfg80211_stop_ap(rdev, dev, true);
10481049
break;
10491050
case NL80211_IFTYPE_ADHOC:

0 commit comments

Comments
 (0)