minstrel_ht: fix BUG_ON(rate[0]->idx < 0)
PATCH 1/1 minstrel_ht: fix BUG_ON(rate[0]->idx < 0)
This patch fixes a panic which can be triggered by an out-of-bound array access.
Signed-off-by Christian Lamparter <[email protected]>
---
static u8 sample_table[SAMPLE_COLUMNS][MCS_GROUP_RATES];
---
net/mac80211/rc80211_minstrel_ht.c renamed from net/mac80211/rc80211_minstrel_ht.c.orig +2 -2
@@ -318,9 +318,9 @@ minstrel_next_sample_idx(struct minstrelif (!mg->supported)continue ; -if (++mg->index >MCS_GROUP_RATES ) { +if (++mg->index >=MCS_GROUP_RATES ) { mg->index =0 ; -if (++mg->column >ARRAY_SIZE (sample_table)) +if (++mg->column >=ARRAY_SIZE (sample_table)) mg->column =0 ; }break ;