Эх сурвалжийг харах

mac80211: bail out from prep_connection() if a reconfig is ongoing

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 <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Luca Coelho 8 жил өмнө
parent
commit
f8860ce836

+ 4 - 0
net/mac80211/mlme.c

@@ -4382,6 +4382,10 @@ static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata,
 	if (WARN_ON(!ifmgd->auth_data && !ifmgd->assoc_data))
 	if (WARN_ON(!ifmgd->auth_data && !ifmgd->assoc_data))
 		return -EINVAL;
 		return -EINVAL;
 
 
+	/* If a reconfig is happening, bail out */
+	if (local->in_reconfig)
+		return -EBUSY;
+
 	if (assoc) {
 	if (assoc) {
 		rcu_read_lock();
 		rcu_read_lock();
 		have_sta = sta_info_get(sdata, cbss->bssid);
 		have_sta = sta_info_get(sdata, cbss->bssid);