diff options
author | Johannes Berg <johannes.berg@intel.com> | 2015-08-21 08:07:13 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2015-09-22 09:19:48 -0400 |
commit | 2df1b131b54f431877a6665139dac805ba5ce1a5 (patch) | |
tree | 1d3d5cfe6ec5cbc2211ca02c835b92ef45ba293c /net/mac80211 | |
parent | ef9be10c8c999e00b239eec24cf01952a308f8e7 (diff) |
mac80211: fix VHT MCS mask array overrun
The HT MCS mask has 9 bytes, the VHT one only has 8 streams.
Split the loops to handle this correctly.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/cfg.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 17b1fe961c5d..a30ec3ce3d25 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -2518,15 +2518,17 @@ static int ieee80211_set_bitrate_mask(struct wiphy *wiphy, | |||
2518 | continue; | 2518 | continue; |
2519 | 2519 | ||
2520 | for (j = 0; j < IEEE80211_HT_MCS_MASK_LEN; j++) { | 2520 | for (j = 0; j < IEEE80211_HT_MCS_MASK_LEN; j++) { |
2521 | if (~sdata->rc_rateidx_mcs_mask[i][j]) | 2521 | if (~sdata->rc_rateidx_mcs_mask[i][j]) { |
2522 | sdata->rc_has_mcs_mask[i] = true; | 2522 | sdata->rc_has_mcs_mask[i] = true; |
2523 | break; | ||
2524 | } | ||
2525 | } | ||
2523 | 2526 | ||
2524 | if (~sdata->rc_rateidx_vht_mcs_mask[i][j]) | 2527 | for (j = 0; j < NL80211_VHT_NSS_MAX; j++) { |
2528 | if (~sdata->rc_rateidx_vht_mcs_mask[i][j]) { | ||
2525 | sdata->rc_has_vht_mcs_mask[i] = true; | 2529 | sdata->rc_has_vht_mcs_mask[i] = true; |
2526 | |||
2527 | if (sdata->rc_has_mcs_mask[i] && | ||
2528 | sdata->rc_has_vht_mcs_mask[i]) | ||
2529 | break; | 2530 | break; |
2531 | } | ||
2530 | } | 2532 | } |
2531 | } | 2533 | } |
2532 | 2534 | ||