From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EDFC7C43219 for ; Wed, 24 Nov 2021 13:16:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345506AbhKXNTV (ORCPT ); Wed, 24 Nov 2021 08:19:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:35228 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244682AbhKXNRQ (ORCPT ); Wed, 24 Nov 2021 08:17:16 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8E3B561439; Wed, 24 Nov 2021 12:44:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1637757897; bh=ftMJjk/rcubRpf0OAIbomDO4tHJC8nhMo8dvK4+T+ZA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JtiguAgmjrVq8tdGys8RYZPkKWYUujDf7WlxGMPYAA3/626Muf1gp8P4/Gs5rU1Ek FlDg/JMqFwlA3h7eUmhrokmFT9AUDG/XH24NC+ZU/2PenkKPvIyCS7/IopaairHMZd qvicEqkT+xw6Ln3Gn6staKlHGpkv1T6K+LJgGAaw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nguyen Dinh Phi , syzbot+bbf402b783eeb6d908db@syzkaller.appspotmail.com, Johannes Berg Subject: [PATCH 4.19 312/323] cfg80211: call cfg80211_stop_ap when switch from P2P_GO type Date: Wed, 24 Nov 2021 12:58:22 +0100 Message-Id: <20211124115729.457628793@linuxfoundation.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211124115718.822024889@linuxfoundation.org> References: <20211124115718.822024889@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Nguyen Dinh Phi 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 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 Signed-off-by: Greg Kroah-Hartman --- net/wireless/util.c | 1 + 1 file changed, 1 insertion(+) --- a/net/wireless/util.c +++ b/net/wireless/util.c @@ -950,6 +950,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: