Skip to content

Commit

Permalink
nl80211: Fix possible Spectre-v1 for NL80211_TXRATE_HT
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Masashi Honma authored and Johannes Berg committed Sep 26, 2018
1 parent 0bcbf65 commit 30fe6d5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 30fe6d5

Please sign in to comment.