mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
nl80211: Fix possible Spectre-v1 for NL80211_TXRATE_HT
[ Upstream commit 30fe6d50eb ]
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>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user