From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-dm3nam03on0111.outbound.protection.outlook.com ([104.47.41.111]:6417 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S935115AbeCSQLp (ORCPT ); Mon, 19 Mar 2018 12:11:45 -0400 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Luca Coelho , Johannes Berg , Sasha Levin Subject: [PATCH AUTOSEL for 3.18 004/102] mac80211: bail out from prep_connection() if a reconfig is ongoing Date: Mon, 19 Mar 2018 16:11:29 +0000 Message-ID: <20180319161117.17833-4-alexander.levin@microsoft.com> References: <20180319161117.17833-1-alexander.levin@microsoft.com> In-Reply-To: <20180319161117.17833-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Luca Coelho [ Upstream commit f8860ce836f2d502b07ef99559707fe55d90f5bc ] If ieee80211_hw_restart() is called during authentication, the authentication process will continue, causing the driver to be called in a wrong state. This ultimately causes an oops in the iwlwifi driver (at least). This fixes bugzilla 195299 partly. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=3D195299 Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/mlme.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index b13634c677f1..156e8e13ffed 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -3995,6 +3995,10 @@ static int ieee80211_prep_connection(struct ieee8021= 1_sub_if_data *sdata, if (WARN_ON(!ifmgd->auth_data && !ifmgd->assoc_data)) return -EINVAL; =20 + /* If a reconfig is happening, bail out */ + if (local->in_reconfig) + return -EBUSY; + if (assoc) { rcu_read_lock(); have_sta =3D sta_info_get(sdata, cbss->bssid); --=20 2.14.1