Skip to content

Commit d76360a

Browse files
jmberg-intelgregkh
authored andcommitted
wifi: iwlwifi: mvm: drop wrong STA selection in TX
[ Upstream commit 1c7e106 ] This shouldn't happen at all, since in station mode all MMPDUs go through the TXQ for the STA, and not this function. There may or may not be a race in mac80211 through which this might happen for some frames while a station is being added, but in that case we can also just drop the frame and pretend the STA didn't exist yet. Also, the code is simply wrong since it uses deflink, and it's not easy to fix it since the mvmvif->ap_sta pointer cannot be used without the mutex, and perhaps the right link might not even be known. Just drop the frame at that point instead of trying to fix it up. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://patch.msgid.link/20240808232017.45ad105dc7fe.I6d45c82e5758395d9afb8854057ded03c7dc81d7@changeid Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 191e8d5 commit d76360a

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

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

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -766,20 +766,10 @@ void iwl_mvm_mac_tx(struct ieee80211_hw *hw,
766766
if (ieee80211_is_mgmt(hdr->frame_control))
767767
sta = NULL;
768768

769-
/* If there is no sta, and it's not offchannel - send through AP */
769+
/* this shouldn't even happen: just drop */
770770
if (!sta && info->control.vif->type == NL80211_IFTYPE_STATION &&
771-
!offchannel) {
772-
struct iwl_mvm_vif *mvmvif =
773-
iwl_mvm_vif_from_mac80211(info->control.vif);
774-
u8 ap_sta_id = READ_ONCE(mvmvif->deflink.ap_sta_id);
775-
776-
if (ap_sta_id < mvm->fw->ucode_capa.num_stations) {
777-
/* mac80211 holds rcu read lock */
778-
sta = rcu_dereference(mvm->fw_id_to_mac_id[ap_sta_id]);
779-
if (IS_ERR_OR_NULL(sta))
780-
goto drop;
781-
}
782-
}
771+
!offchannel)
772+
goto drop;
783773

784774
if (tmp_sta && !sta && link_id != IEEE80211_LINK_UNSPECIFIED &&
785775
!ieee80211_is_probe_resp(hdr->frame_control)) {

0 commit comments

Comments
 (0)