Skip to content

Commit b719838

Browse files
egrumbachjmberg-intel
authored andcommitted
wifi: iwlwifi: mvm: fix a crash when we run out of stations
A DoS tool that injects loads of authentication frames made our AP crash. The iwl_mvm_is_dup() function couldn't find the per-queue dup_data which was not allocated. The root cause for that is that we ran out of stations in the firmware and we didn't really add the station to the firmware, yet we didn't return an error to mac80211. Mac80211 was thinking that we have the station and because of that, sta_info::uploaded was set to 1. This allowed ieee80211_find_sta_by_ifaddr() to return a valid station object, but that ieee80211_sta didn't have any iwl_mvm_sta object initialized and that caused the crash mentioned earlier when we got Rx on that station. Cc: [email protected] Fixes: 57974a5 ("wifi: iwlwifi: mvm: refactor iwl_mvm_mac_sta_state_common()") Signed-off-by: Emmanuel Grumbach <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://msgid.link/20240206175739.1f76c44b2486.I6a00955e2842f15f0a089db2f834adb9d10fbe35@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 65c6ee9 commit b719838

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3687,6 +3687,9 @@ iwl_mvm_sta_state_notexist_to_none(struct iwl_mvm *mvm,
36873687
NL80211_TDLS_SETUP);
36883688
}
36893689

3690+
if (ret)
3691+
return ret;
3692+
36903693
for_each_sta_active_link(vif, sta, link_sta, i)
36913694
link_sta->agg.max_rc_amsdu_len = 1;
36923695

drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,10 @@ static bool iwl_mvm_is_dup(struct ieee80211_sta *sta, int queue,
505505
return false;
506506

507507
mvm_sta = iwl_mvm_sta_from_mac80211(sta);
508+
509+
if (WARN_ON_ONCE(!mvm_sta->dup_data))
510+
return false;
511+
508512
dup_data = &mvm_sta->dup_data[queue];
509513

510514
/*

0 commit comments

Comments
 (0)