Skip to content

Commit 17f6451

Browse files
benzeajmberg-intel
authored andcommitted
wifi: iwlwifi: mvm: guard against invalid STA ID on removal
Guard against invalid station IDs in iwl_mvm_mld_rm_sta_id as that would result in out-of-bounds array accesses. This prevents issues should the driver get into a bad state during error handling. Signed-off-by: Benjamin Berg <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://msgid.link/20240320232419.d523167bda9c.I1cffd86363805bf86a95d8bdfd4b438bb54baddc@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent c2ace63 commit 17f6451

File tree

1 file changed

+6
-1
lines changed
  • drivers/net/wireless/intel/iwlwifi/mvm

1 file changed

+6
-1
lines changed

drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,10 +855,15 @@ int iwl_mvm_mld_rm_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
855855

856856
int iwl_mvm_mld_rm_sta_id(struct iwl_mvm *mvm, u8 sta_id)
857857
{
858-
int ret = iwl_mvm_mld_rm_sta_from_fw(mvm, sta_id);
858+
int ret;
859859

860860
lockdep_assert_held(&mvm->mutex);
861861

862+
if (WARN_ON(sta_id == IWL_MVM_INVALID_STA))
863+
return 0;
864+
865+
ret = iwl_mvm_mld_rm_sta_from_fw(mvm, sta_id);
866+
862867
RCU_INIT_POINTER(mvm->fw_id_to_mac_id[sta_id], NULL);
863868
RCU_INIT_POINTER(mvm->fw_id_to_link_sta[sta_id], NULL);
864869
return ret;

0 commit comments

Comments
 (0)