aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-07-04 09:55:29 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-11 21:35:22 -0400
commit139ce60dd49cae12137947393917efb10bbcc219 (patch)
tree26d52ad7b333d8facd5141dbbefffd517ddc14ae
parentd9bd9f5e484d91b89f022d40a925f2870502e4af (diff)
iwlwifi: mvm: refuse connection to APs with BI < 16
commit 48bc13072109ea58465542aa1ee31b4e1065468a upstream. Due to a firmware bug, it crashes when the beacon interval is smaller than 16. Avoid this by refusing the station state change creating the AP station, causing mac80211 to abandon the attempt to connect to the AP, and eventually wpa_s to blacklist it. Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/mac80211.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
index a5eb8c82f16a..b7e95b0a42b7 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
@@ -987,6 +987,21 @@ static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw,
987 mutex_lock(&mvm->mutex); 987 mutex_lock(&mvm->mutex);
988 if (old_state == IEEE80211_STA_NOTEXIST && 988 if (old_state == IEEE80211_STA_NOTEXIST &&
989 new_state == IEEE80211_STA_NONE) { 989 new_state == IEEE80211_STA_NONE) {
990 /*
991 * Firmware bug - it'll crash if the beacon interval is less
992 * than 16. We can't avoid connecting at all, so refuse the
993 * station state change, this will cause mac80211 to abandon
994 * attempts to connect to this AP, and eventually wpa_s will
995 * blacklist the AP...
996 */
997 if (vif->type == NL80211_IFTYPE_STATION &&
998 vif->bss_conf.beacon_int < 16) {
999 IWL_ERR(mvm,
1000 "AP %pM beacon interval is %d, refusing due to firmware bug!\n",
1001 sta->addr, vif->bss_conf.beacon_int);
1002 ret = -EINVAL;
1003 goto out_unlock;
1004 }
990 ret = iwl_mvm_add_sta(mvm, vif, sta); 1005 ret = iwl_mvm_add_sta(mvm, vif, sta);
991 } else if (old_state == IEEE80211_STA_NONE && 1006 } else if (old_state == IEEE80211_STA_NONE &&
992 new_state == IEEE80211_STA_AUTH) { 1007 new_state == IEEE80211_STA_AUTH) {
@@ -1015,6 +1030,7 @@ static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw,
1015 } else { 1030 } else {
1016 ret = -EIO; 1031 ret = -EIO;
1017 } 1032 }
1033 out_unlock:
1018 mutex_unlock(&mvm->mutex); 1034 mutex_unlock(&mvm->mutex);
1019 1035
1020 return ret; 1036 return ret;