nl80211: Fix possible Spectre-v1 for CQM RSSI thresholds
authorMasashi Honma <masashi.honma@gmail.com>
Tue, 25 Sep 2018 02:15:01 +0000 (11:15 +0900)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 27 Sep 2018 09:44:44 +0000 (11:44 +0200)
commit1222a16014888ed9733c11e221730d4a8196222b
tree996fc5f62a229ad0d726fa868eecf21cc4ff7ba9
parent28ef8b49a338dc1844e86b7954cfffc7dfa2660a
nl80211: Fix possible Spectre-v1 for CQM RSSI thresholds

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

Note that the user doesn't control i directly, but can make it out
of bounds by not finding a threshold in the array.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
[add note about user control, as explained by Masashi]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/nl80211.c