From: Greg Kroah-Hartman Date: Thu, 12 Oct 2023 16:49:19 +0000 (+0200) Subject: 5.4-stable patches X-Git-Tag: v6.1.58~44 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=76cffad352b7f49039f78829b88128e0f8797532;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: lib-test_meminit-fix-off-by-one-error-in-test_pages.patch --- diff --git a/queue-5.4/lib-test_meminit-fix-off-by-one-error-in-test_pages.patch b/queue-5.4/lib-test_meminit-fix-off-by-one-error-in-test_pages.patch new file mode 100644 index 00000000000..741bb93f620 --- /dev/null +++ b/queue-5.4/lib-test_meminit-fix-off-by-one-error-in-test_pages.patch @@ -0,0 +1,41 @@ +From gregkh@linuxfoundation.org Thu Oct 12 18:44:27 2023 +From: Greg Kroah-Hartman +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 , Andrew Donnellan , Alexander Potapenko , Xiaoke Wang , stable@vger.kernel.org, Andrew Morton +Message-ID: <2023101238-greasily-reiterate-aafc@gregkh> + +From: Greg Kroah-Hartman + +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: cbfffe51221b ("lib/test_meminit: allocate pages up to order MAX_ORDER") +Cc: Andrew Donnellan +Cc: Alexander Potapenko +Cc: Xiaoke Wang +Cc: +Cc: Andrew Morton +Signed-off-by: Greg Kroah-Hartman +--- + lib/test_meminit.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/lib/test_meminit.c ++++ b/lib/test_meminit.c +@@ -86,7 +86,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(); diff --git a/queue-5.4/series b/queue-5.4/series index ac8ab4a8478..5f29ee5f70d 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -1,2 +1,3 @@ rdma-cxgb4-check-skb-value-for-failure-to-allocate.patch platform-x86-hp-wmi-mark-driver-struct-with-__refdat.patch +lib-test_meminit-fix-off-by-one-error-in-test_pages.patch