From: Greg Kroah-Hartman Date: Thu, 19 Sep 2019 14:19:47 +0000 (+0200) Subject: 5.3-stable patches X-Git-Tag: v4.4.194~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2c7c18b9929930e2b71bda1415445fc1a278444d;p=thirdparty%2Fkernel%2Fstable-queue.git 5.3-stable patches added patches: nl80211-fix-possible-spectre-v1-for-cqm-rssi-thresholds.patch --- diff --git a/queue-5.3/nl80211-fix-possible-spectre-v1-for-cqm-rssi-thresholds.patch b/queue-5.3/nl80211-fix-possible-spectre-v1-for-cqm-rssi-thresholds.patch new file mode 100644 index 00000000000..27dbc3c073c --- /dev/null +++ b/queue-5.3/nl80211-fix-possible-spectre-v1-for-cqm-rssi-thresholds.patch @@ -0,0 +1,42 @@ +From 4b2c5a14cd8005a900075f7dfec87473c6ee66fb Mon Sep 17 00:00:00 2001 +From: Masashi Honma +Date: Sun, 8 Sep 2019 09:56:53 +0900 +Subject: nl80211: Fix possible Spectre-v1 for CQM RSSI thresholds + +From: Masashi Honma + +commit 4b2c5a14cd8005a900075f7dfec87473c6ee66fb upstream. + +commit 1222a1601488 ("nl80211: Fix possible Spectre-v1 for CQM +RSSI thresholds") was incomplete and requires one more fix to +prevent accessing to rssi_thresholds[n] because user can control +rssi_thresholds[i] values to make i reach to n. For example, +rssi_thresholds = {-400, -300, -200, -100} when last is -34. + +Cc: stable@vger.kernel.org +Fixes: 1222a1601488 ("nl80211: Fix possible Spectre-v1 for CQM RSSI thresholds") +Reported-by: Dan Carpenter +Signed-off-by: Masashi Honma +Link: https://lore.kernel.org/r/20190908005653.17433-1-masashi.honma@gmail.com +Signed-off-by: Johannes Berg +Signed-off-by: Greg Kroah-Hartman + +--- + net/wireless/nl80211.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/net/wireless/nl80211.c ++++ b/net/wireless/nl80211.c +@@ -10659,9 +10659,11 @@ static int cfg80211_cqm_rssi_update(stru + hyst = wdev->cqm_config->rssi_hyst; + n = wdev->cqm_config->n_rssi_thresholds; + +- for (i = 0; i < n; i++) ++ for (i = 0; i < n; i++) { ++ i = array_index_nospec(i, n); + if (last < wdev->cqm_config->rssi_thresholds[i]) + break; ++ } + + low_index = i - 1; + if (low_index >= 0) { diff --git a/queue-5.3/series b/queue-5.3/series index 1b771d04ade..d622f9d5f86 100644 --- a/queue-5.3/series +++ b/queue-5.3/series @@ -13,3 +13,4 @@ documentation-sphinx-add-missing-comma-to-list-of-strings.patch firmware-google-check-if-size-is-valid-when-decoding-vpd-data.patch serial-sprd-correct-the-wrong-sequence-of-arguments.patch tty-serial-atmel-reschedule-tx-after-rx-was-started.patch +nl80211-fix-possible-spectre-v1-for-cqm-rssi-thresholds.patch