]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.3-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Sep 2019 14:19:47 +0000 (16:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Sep 2019 14:19:47 +0000 (16:19 +0200)
added patches:
nl80211-fix-possible-spectre-v1-for-cqm-rssi-thresholds.patch

queue-5.3/nl80211-fix-possible-spectre-v1-for-cqm-rssi-thresholds.patch [new file with mode: 0644]
queue-5.3/series

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 (file)
index 0000000..27dbc3c
--- /dev/null
@@ -0,0 +1,42 @@
+From 4b2c5a14cd8005a900075f7dfec87473c6ee66fb Mon Sep 17 00:00:00 2001
+From: Masashi Honma <masashi.honma@gmail.com>
+Date: Sun, 8 Sep 2019 09:56:53 +0900
+Subject: nl80211: Fix possible Spectre-v1 for CQM RSSI thresholds
+
+From: Masashi Honma <masashi.honma@gmail.com>
+
+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 <dan.carpenter@oracle.com>
+Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
+Link: https://lore.kernel.org/r/20190908005653.17433-1-masashi.honma@gmail.com
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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) {
index 1b771d04ade80598abfc735e7929ef4ca8c7b218..d622f9d5f86c61d263fce83a126b979e8418303c 100644 (file)
@@ -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