summaryrefslogtreecommitdiff
path: root/net/wireless
diff options
context:
space:
mode:
authorMasashi Honma <masashi.honma@gmail.com>2018-09-25 11:15:00 +0900
committerJohannes Berg <johannes.berg@intel.com>2018-09-26 11:17:32 +0200
commit30fe6d50eb088783c8729c7d930f65296b2b3fa7 (patch)
tree1755afa4e983239ef5128b4683daea13efb49100 /net/wireless
parent0bcbf6518456f63038a290bd359237d31f6f8ac3 (diff)
nl80211: Fix possible Spectre-v1 for NL80211_TXRATE_HT
Use array_index_nospec() to sanitize ridx with respect to speculation. Signed-off-by: Masashi Honma <masashi.honma@gmail.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/nl80211.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 4b8ec659e797..bd26230de63e 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -3756,6 +3756,7 @@ static bool ht_rateset_to_mask(struct ieee80211_supported_band *sband,
return false;
/* check availability */
+ ridx = array_index_nospec(ridx, IEEE80211_HT_MCS_MASK_LEN);
if (sband->ht_cap.mcs.rx_mask[ridx] & rbit)
mcs[ridx] |= rbit;
else