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 DB68EC433F5 for ; Wed, 24 Nov 2021 12:14:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241050AbhKXMRi (ORCPT ); Wed, 24 Nov 2021 07:17:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:33914 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242750AbhKXMLU (ORCPT ); Wed, 24 Nov 2021 07:11:20 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id CDBCE6104F; Wed, 24 Nov 2021 12:06:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1637755577; bh=gds4oHFyROa3JTEUIdwUap7ISPton9GKqcqF0QpFDeQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OQOKYpDSRWuB1N/eILfSSFmOJJ95bGK4UU2jf9j2noe+WhNwfuv1rk74uSpIjV2kR K3Kc3T1eFVj9mOSPcU+lItxAVD6BKmSgV6KyogSjVhLnIWNGg2VioiTwfgeX1CFaip s9EXRc1RG6SZLvu01Pv+ATslJvXrXRo8hQhCulfo= 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.4 146/162] cfg80211: call cfg80211_stop_ap when switch from P2P_GO type Date: Wed, 24 Nov 2021 12:57:29 +0100 Message-Id: <20211124115703.000074135@linuxfoundation.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211124115658.328640564@linuxfoundation.org> References: <20211124115658.328640564@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: linux-kernel@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 @@ -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: