summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorMasashi Honma <masashi.honma@gmail.com>2018-09-25 11:15:00 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-11-10 07:42:42 -0800
commit6e93cd9e17e0c101b7203d69be3f1d7f51f6b5a1 (patch)
tree20e59e5a79eb3e97711877dbc892621310b642d4 /net
parent83eb6dd71d241f9e84a087a539c91623e971cff7 (diff)
nl80211: Fix possible Spectre-v1 for NL80211_TXRATE_HT
[ Upstream commit 30fe6d50eb088783c8729c7d930f65296b2b3fa7 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net')
-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 0e91ec49d3da..549d0a4083b3 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -3422,6 +3422,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