Thread (5 messages) 5 messages, 2 authors, 2018-09-27

[PATCH 1/2] nl80211: Fix possible Spectre-v1 for NL80211_TXRATE_HT

STALE2928d

From: Masashi Honma <hidden>
Date: 2018-09-25 02:15:21
Subsystem: 802.11 (including cfg80211/nl80211), the rest · Maintainers: Johannes Berg, Linus Torvalds

Use array_index_nospec() to sanitize ridx with respect to speculation.

Signed-off-by: Masashi Honma <redacted>
---
 net/wireless/nl80211.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 0827cbd..3c469c1 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -3748,6 +3748,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
-- 
2.7.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help