Skip to content

Commit 27a221f

Browse files
Dan CarpenterKalle Valo
authored andcommitted
iwlwifi: mvm: d3: Fix off by ones in iwl_mvm_wowlan_get_rsc_v5_data()
These should be >= ARRAY_SIZE() instead of > ARRAY_SIZE() to prevent an out of bounds write on the next line. Fixes: 79e561f ("iwlwifi: mvm: d3: implement RSC command version 5") Signed-off-by: Dan Carpenter <[email protected]> Acked-by: Luca Coelho <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/20210831081802.GA9846@kili
1 parent 24d5f16 commit 27a221f

File tree

1 file changed

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

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,11 +360,11 @@ static void iwl_mvm_wowlan_get_rsc_v5_data(struct ieee80211_hw *hw,
360360
if (sta) {
361361
rsc = data->rsc->ucast_rsc;
362362
} else {
363-
if (WARN_ON(data->gtks > ARRAY_SIZE(data->gtk_ids)))
363+
if (WARN_ON(data->gtks >= ARRAY_SIZE(data->gtk_ids)))
364364
return;
365365
data->gtk_ids[data->gtks] = key->keyidx;
366366
rsc = data->rsc->mcast_rsc[data->gtks % 2];
367-
if (WARN_ON(key->keyidx >
367+
if (WARN_ON(key->keyidx >=
368368
ARRAY_SIZE(data->rsc->mcast_key_id_map)))
369369
return;
370370
data->rsc->mcast_key_id_map[key->keyidx] = data->gtks % 2;

0 commit comments

Comments
 (0)