diff options
author | Masashi Honma <masashi.honma@gmail.com> | 2018-09-25 11:15:00 +0900 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-11-10 07:42:42 -0800 |
commit | 6e93cd9e17e0c101b7203d69be3f1d7f51f6b5a1 (patch) | |
tree | 20e59e5a79eb3e97711877dbc892621310b642d4 /net | |
parent | 83eb6dd71d241f9e84a087a539c91623e971cff7 (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.c | 1 |
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 |