This is a note to let you know that I've just added the patch titled cfg80211: call cfg80211_stop_ap when switch from P2P_GO type to the 4.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: cfg80211-call-cfg80211_stop_ap-when-switch-from-p2p_go-type.patch and it can be found in the queue-4.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 563fbefed46ae4c1f70cffb8eb54c02df480b2c2 Mon Sep 17 00:00:00 2001 From: Nguyen Dinh Phi <phind.uet@xxxxxxxxx> Date: Thu, 28 Oct 2021 01:37:22 +0800 Subject: cfg80211: call cfg80211_stop_ap when switch from P2P_GO type From: Nguyen Dinh Phi <phind.uet@xxxxxxxxx> 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@xxxxxxxxx> Reported-by: syzbot+bbf402b783eeb6d908db@xxxxxxxxxxxxxxxxxxxxxxxxx Link: https://lore.kernel.org/r/20211027173722.777287-1-phind.uet@xxxxxxxxx Cc: stable@xxxxxxxxxxxxxxx Fixes: ac800140c20e ("cfg80211: .stop_ap when interface is going down") Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- net/wireless/util.c | 1 + 1 file changed, 1 insertion(+) --- a/net/wireless/util.c +++ b/net/wireless/util.c @@ -963,6 +963,7 @@ int cfg80211_change_iface(struct cfg8021 switch (otype) { case NL80211_IFTYPE_AP: + case NL80211_IFTYPE_P2P_GO: cfg80211_stop_ap(rdev, dev, true); break; case NL80211_IFTYPE_ADHOC: Patches currently in stable-queue which might be from phind.uet@xxxxxxxxx are queue-4.4/cfg80211-call-cfg80211_stop_ap-when-switch-from-p2p_go-type.patch