Received: by 10.213.65.68 with SMTP id h4csp470430imn; Fri, 16 Mar 2018 08:44:37 -0700 (PDT) X-Google-Smtp-Source: AG47ELup7h8slBcZjN4pRcm8BPtTrv79bcWRTb1aIM/ZUaC/YVKx8yWjaZu5V3oQq8vO4EU7vCwS X-Received: by 10.101.83.199 with SMTP id z7mr1852823pgr.105.1521215077747; Fri, 16 Mar 2018 08:44:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521215077; cv=none; d=google.com; s=arc-20160816; b=ixTBmerzDSG5BHh8BABldmw+eqtkG7Xk1hPGqrdhTb424pBfbfGjIo29XgcMNN3/Jy XFwygItW19ztizrr7jWsodgguphSHjkOzEnMBYd5j8v7AJur/+BCL+4m5fO6k995YRVI dGg77x1Hhu0XxK9EmZP5JZ2Pvz5u6l+UTDUrKlL2OoqQ6J3fbwpPRDDcRbaVTzTTlXGb T51RfSfclq062YevhmRkilBF+2vbY3eBJgtWO7EheElJVxq+LcOWmjwzYiKzO4lkcWfI s4NvtybvPu1dKP8ZMy5wGPcYWaxulgFHkT+ERjaKDBVjFz9i5D5ifP7oyuyTRr7GzxJb pzxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=3S5hkyfGenmLTQWZzA1c/6aC4zRY6q38nGIV2A+BxFI=; b=NJNmJKLlmX3DmPDHw8JdAHrEQKC+DzzNB7USjClr55wYIa83rtn1/UFfXk/DKiNEy0 ZKfEkFJQd1nuXvh3w19gta7ovOeQL1O2RaEDL97v0gNwTUgg+kK3Y4YPgMYoO7d/5vvB wZFSwef4PUNyfEd9V32LlLFSQy1hz+2FXWbmsuCzQ0Qf2+kqALQudKpG2qHNb4jkwf6G gNJZ/kMwE5jN5aIF0gc/NQ5rdIZbrqw7BFo/LCyneVDQkbh97IqYGeZyNWsMjluKn38i er2EMQohBYeoHkk7E+a1gaX5iMmE3HDY+J5PhbcKOS+Y+zPyToer/A3XdKj/uOAUgwc5 5vWg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u63si2439898pgc.638.2018.03.16.08.44.15; Fri, 16 Mar 2018 08:44:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965258AbeCPPn1 (ORCPT + 99 others); Fri, 16 Mar 2018 11:43:27 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45096 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965014AbeCPPnX (ORCPT ); Fri, 16 Mar 2018 11:43:23 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 695E539; Fri, 16 Mar 2018 15:43:22 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Limin Zhu , Xinming Hu , Kalle Valo , Sasha Levin Subject: [PATCH 4.15 094/128] mwifiex: cfg80211: do not change virtual interface during scan processing Date: Fri, 16 Mar 2018 16:23:55 +0100 Message-Id: <20180316152341.246459244@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152336.199007505@linuxfoundation.org> References: <20180316152336.199007505@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Limin Zhu [ Upstream commit c61cfe49f0f0f0d1f8b56d0b045838d597e8c3a3 ] (1) Change virtual interface operation in cfg80211 process reset and reinitilize private data structure. (2) Scan result event processed in main process will dereference private data structure concurrently, ocassionly crash the kernel. The cornel case could be trigger by below steps: (1) wpa_cli mlan0 scan (2) ./hostapd mlan0.conf Cfg80211 asynchronous scan procedure is not all the time operated under rtnl lock, here we add the protect to serialize the cfg80211 scan and change_virtual interface operation. Signed-off-by: Limin Zhu Signed-off-by: Xinming Hu Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/marvell/mwifiex/cfg80211.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c @@ -1116,6 +1116,12 @@ mwifiex_cfg80211_change_virtual_intf(str struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); enum nl80211_iftype curr_iftype = dev->ieee80211_ptr->iftype; + if (priv->scan_request) { + mwifiex_dbg(priv->adapter, ERROR, + "change virtual interface: scan in process\n"); + return -EBUSY; + } + switch (curr_iftype) { case NL80211_IFTYPE_ADHOC: switch (type) {