diff options
author | Eyal Shapira <eyal@wizery.com> | 2015-01-16 04:09:30 -0500 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2015-01-20 01:47:16 -0500 |
commit | 2cee4762c528a9bd2cdff793197bf591a2196c11 (patch) | |
tree | 65fc2d1d2583eeadb45b8c75e7653d75cfb6de93 /drivers/net/wireless | |
parent | 90ea15c1148bb1517e400ed14bb875e330aead2e (diff) |
iwlwifi: mvm: validate tid and sta_id in ba_notif
These are coming from the FW and are used to access arrays.
Bad values can cause an out of bounds access so discard
such ba_notifs and warn.
CC: <stable@vger.kernel.org> [3.10+]
Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/tx.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/tx.c b/drivers/net/wireless/iwlwifi/mvm/tx.c index c59d07567d90..650a5f0b94c7 100644 --- a/drivers/net/wireless/iwlwifi/mvm/tx.c +++ b/drivers/net/wireless/iwlwifi/mvm/tx.c | |||
@@ -930,6 +930,11 @@ int iwl_mvm_rx_ba_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb, | |||
930 | sta_id = ba_notif->sta_id; | 930 | sta_id = ba_notif->sta_id; |
931 | tid = ba_notif->tid; | 931 | tid = ba_notif->tid; |
932 | 932 | ||
933 | if (WARN_ONCE(sta_id >= IWL_MVM_STATION_COUNT || | ||
934 | tid >= IWL_MAX_TID_COUNT, | ||
935 | "sta_id %d tid %d", sta_id, tid)) | ||
936 | return 0; | ||
937 | |||
933 | rcu_read_lock(); | 938 | rcu_read_lock(); |
934 | 939 | ||
935 | sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]); | 940 | sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]); |