Commit 6e93cd9e authored by Masashi Honma's avatar Masashi Honma Committed by Greg Kroah-Hartman

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: 's avatarMasashi Honma <masashi.honma@gmail.com>
Signed-off-by: 's avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: 's avatarSasha Levin <sashal@kernel.org>
parent 83eb6dd7
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment