From: Luca Coelho Date: Tue, 2 May 2017 14:56:21 +0000 (+0300) Subject: mac80211: bail out from prep_connection() if a reconfig is ongoing X-Git-Tag: v4.9.94~299 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a4e074608e2d9cd40802ed10b877ffb202aae95c;p=platform%2Fkernel%2Flinux-amlogic.git mac80211: bail out from prep_connection() if a reconfig is ongoing [ 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=195299 Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index fdab4f1..e6f42d1 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -4332,6 +4332,10 @@ static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata, if (WARN_ON(!ifmgd->auth_data && !ifmgd->assoc_data)) return -EINVAL; + /* If a reconfig is happening, bail out */ + if (local->in_reconfig) + return -EBUSY; + if (assoc) { rcu_read_lock(); have_sta = sta_info_get(sdata, cbss->bssid);