summaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2016-09-14 03:23:51 -0400
committerJohannes Berg <johannes.berg@intel.com>2016-09-15 10:46:16 -0400
commit93db1d9e6c96050b74bb2793de8db00cd0afe6ab (patch)
tree83a76bdd049de1a15b56a6d9cd4243486d1d5a0e /net/mac80211/mlme.c
parentf1c1f17ac52d22227c0074b3d661d7ed692b707a (diff)
mac80211: fix possible out-of-bounds access
In the unlikely situation that the supplicant has negotiated admission for the background AC (which it has no reason to as it's not supposed to be requiring admission control to start with, and we'd ignore such a requirement anyway), the loop here may terminate with non_acm_ac == 4, which leads to an array overrun. Check this explicitly just for completeness. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 8d426f637f58..7486f2dab4ba 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1672,11 +1672,15 @@ __ieee80211_sta_handle_tspec_ac_params(struct ieee80211_sub_if_data *sdata)
1672 non_acm_ac++) 1672 non_acm_ac++)
1673 if (!(sdata->wmm_acm & BIT(7 - 2 * non_acm_ac))) 1673 if (!(sdata->wmm_acm & BIT(7 - 2 * non_acm_ac)))
1674 break; 1674 break;
1675 /* The loop will result in using BK even if it requires 1675 /* Usually the loop will result in using BK even if it
1676 * admission control, such configuration makes no sense 1676 * requires admission control, but such a configuration
1677 * and we have to transmit somehow - the AC selection 1677 * makes no sense and we have to transmit somehow - the
1678 * does the same thing. 1678 * AC selection does the same thing.
1679 * If we started out trying to downgrade from BK, then
1680 * the extra condition here might be needed.
1679 */ 1681 */
1682 if (non_acm_ac >= IEEE80211_NUM_ACS)
1683 non_acm_ac = IEEE80211_AC_BK;
1680 if (drv_conf_tx(local, sdata, ac, 1684 if (drv_conf_tx(local, sdata, ac,
1681 &sdata->tx_conf[non_acm_ac])) 1685 &sdata->tx_conf[non_acm_ac]))
1682 sdata_err(sdata, 1686 sdata_err(sdata,