]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.1-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Oct 2023 16:49:54 +0000 (18:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Oct 2023 16:49:54 +0000 (18:49 +0200)
added patches:
lib-test_meminit-fix-off-by-one-error-in-test_pages.patch

queue-6.1/lib-test_meminit-fix-off-by-one-error-in-test_pages.patch [new file with mode: 0644]
queue-6.1/series

diff --git a/queue-6.1/lib-test_meminit-fix-off-by-one-error-in-test_pages.patch b/queue-6.1/lib-test_meminit-fix-off-by-one-error-in-test_pages.patch
new file mode 100644 (file)
index 0000000..7f09d25
--- /dev/null
@@ -0,0 +1,41 @@
+From gregkh@linuxfoundation.org  Thu Oct 12 18:44:27 2023
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Date: Thu, 12 Oct 2023 10:17:39 +0200
+Subject: lib/test_meminit: fix off-by-one error in test_pages()
+To: linux-kernel@vger.kernel.org
+Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Andrew Donnellan <ajd@linux.ibm.com>, Alexander Potapenko <glider@google.com>, Xiaoke Wang <xkernel.wang@foxmail.com>, stable@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>
+Message-ID: <2023101238-greasily-reiterate-aafc@gregkh>
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+commit efb78fa86e95 ("lib/test_meminit: allocate pages up to order
+MAX_ORDER") works great in kernels 6.4 and newer thanks to commit
+23baf831a32c ("mm, treewide: redefine MAX_ORDER sanely"), but for older
+kernels, the loop is off by one, which causes crashes when the test
+runs.
+
+Fix this up by changing "<= MAX_ORDER" "< MAX_ORDER" to allow the test
+to work properly for older kernel branches.
+
+Fixes: 421855d0d24d ("lib/test_meminit: allocate pages up to order MAX_ORDER")
+Cc: Andrew Donnellan <ajd@linux.ibm.com>
+Cc: Alexander Potapenko <glider@google.com>
+Cc: Xiaoke Wang <xkernel.wang@foxmail.com>
+Cc: <stable@vger.kernel.org>
+Cc: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ lib/test_meminit.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/lib/test_meminit.c
++++ b/lib/test_meminit.c
+@@ -93,7 +93,7 @@ static int __init test_pages(int *total_
+       int failures = 0, num_tests = 0;
+       int i;
+-      for (i = 0; i <= MAX_ORDER; i++)
++      for (i = 0; i < MAX_ORDER; i++)
+               num_tests += do_alloc_pages_order(i, &failures);
+       REPORT_FAILURES_IN_FN();
index 43fb7f53f7841f68d283e37cd1800d78b23642fc..d1b115e9ddde6aad25743f83f35f272bd5091383 100644 (file)
@@ -5,3 +5,4 @@ rdma-cxgb4-check-skb-value-for-failure-to-allocate.patch
 perf-arm-cmn-fix-the-unhandled-overflow-status-of-co.patch
 platform-x86-think-lmi-fix-reference-leak.patch
 platform-x86-hp-wmi-mark-driver-struct-with-__refdat.patch
+lib-test_meminit-fix-off-by-one-error-in-test_pages.patch