diff options
author | Masashi Honma <masashi.honma@gmail.com> | 2018-09-25 05:15:00 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2018-09-26 12:17:32 +0300 |
commit | 30fe6d50eb088783c8729c7d930f65296b2b3fa7 (patch) | |
tree | 1755afa4e983239ef5128b4683daea13efb49100 /net/wireless | |
parent | 0bcbf6518456f63038a290bd359237d31f6f8ac3 (diff) | |
download | linux-30fe6d50eb088783c8729c7d930f65296b2b3fa7.tar.xz |
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.c | 1 |
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 |