From: Greg Kroah-Hartman Date: Thu, 23 Apr 2026 09:04:31 +0000 (+0200) Subject: 6.18-stable patches X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=68bad48f17bea7bf4785d78eeb3ed0cbc8bf6678;p=thirdparty%2Fkernel%2Fstable-queue.git 6.18-stable patches added patches: kunit-configs-enable-all-crc-tests-in-all_tests.config.patch kunit-configs-enable-all-crypto-library-tests-in-all_tests.config.patch lib-crc-tests-add-a-.kunitconfig-file.patch lib-crc-tests-add-crc_enable_all_for_kunit.patch lib-crc-tests-make-crc_kunit-test-only-the-enabled-crc-variants.patch lib-crypto-tests-add-a-.kunitconfig-file.patch lib-crypto-tests-drop-the-default-to-crypto_selftests.patch lib-crypto-tests-introduce-crypto_lib_enable_all_for_kunit.patch sched-debug-fix-avg_vruntime-usage.patch --- diff --git a/queue-6.18/kunit-configs-enable-all-crc-tests-in-all_tests.config.patch b/queue-6.18/kunit-configs-enable-all-crc-tests-in-all_tests.config.patch new file mode 100644 index 0000000000..a69107c715 --- /dev/null +++ b/queue-6.18/kunit-configs-enable-all-crc-tests-in-all_tests.config.patch @@ -0,0 +1,36 @@ +From stable+bounces-240240-greg=kroah.com@vger.kernel.org Tue Apr 21 23:07:17 2026 +From: Eric Biggers +Date: Tue, 21 Apr 2026 14:05:50 -0700 +Subject: kunit: configs: Enable all CRC tests in all_tests.config +To: stable@vger.kernel.org +Cc: linux-crypto@vger.kernel.org, kunit-dev@googlegroups.com, Eric Biggers , Ard Biesheuvel +Message-ID: <20260421210554.36096-5-ebiggers@kernel.org> + +From: Eric Biggers + +commit 44ff3791d6295f7b51dd2711aad6a03dd79aef22 upstream. + +The new option CONFIG_CRC_ENABLE_ALL_FOR_KUNIT enables all the CRC code +that has KUnit tests, causing CONFIG_KUNIT_ALL_TESTS to enable all these +tests. Add this option to all_tests.config so that kunit.py will run +them when passed the --alltests option. + +Acked-by: Ard Biesheuvel +Link: https://lore.kernel.org/r/20260314172224.15152-1-ebiggers@kernel.org +Signed-off-by: Eric Biggers +Signed-off-by: Greg Kroah-Hartman +--- + tools/testing/kunit/configs/all_tests.config | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/tools/testing/kunit/configs/all_tests.config ++++ b/tools/testing/kunit/configs/all_tests.config +@@ -46,6 +46,8 @@ CONFIG_AUDIT=y + + CONFIG_PRIME_NUMBERS=y + ++CONFIG_CRC_ENABLE_ALL_FOR_KUNIT=y ++ + CONFIG_SECURITY=y + CONFIG_SECURITY_APPARMOR=y + CONFIG_SECURITY_LANDLOCK=y diff --git a/queue-6.18/kunit-configs-enable-all-crypto-library-tests-in-all_tests.config.patch b/queue-6.18/kunit-configs-enable-all-crypto-library-tests-in-all_tests.config.patch new file mode 100644 index 0000000000..786700e1eb --- /dev/null +++ b/queue-6.18/kunit-configs-enable-all-crypto-library-tests-in-all_tests.config.patch @@ -0,0 +1,35 @@ +From stable+bounces-240243-greg=kroah.com@vger.kernel.org Tue Apr 21 23:07:32 2026 +From: Eric Biggers +Date: Tue, 21 Apr 2026 14:05:53 -0700 +Subject: kunit: configs: Enable all crypto library tests in all_tests.config +To: stable@vger.kernel.org +Cc: linux-crypto@vger.kernel.org, kunit-dev@googlegroups.com, Eric Biggers +Message-ID: <20260421210554.36096-8-ebiggers@kernel.org> + +From: Eric Biggers + +commit 8d547482231fef30d0d6440629b73560ad3e937c upstream. + +The new option CONFIG_CRYPTO_LIB_ENABLE_ALL_FOR_KUNIT enables all the +crypto library code that has KUnit tests, causing CONFIG_KUNIT_ALL_TESTS +to enable all these tests. Add this option to all_tests.config so that +kunit.py will run them when passed the --alltests option. + +Link: https://lore.kernel.org/r/20260314035927.51351-3-ebiggers@kernel.org +Signed-off-by: Eric Biggers +Signed-off-by: Greg Kroah-Hartman +--- + tools/testing/kunit/configs/all_tests.config | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/tools/testing/kunit/configs/all_tests.config ++++ b/tools/testing/kunit/configs/all_tests.config +@@ -44,6 +44,8 @@ CONFIG_REGMAP_BUILD=y + + CONFIG_AUDIT=y + ++CONFIG_CRYPTO_LIB_ENABLE_ALL_FOR_KUNIT=y ++ + CONFIG_PRIME_NUMBERS=y + + CONFIG_CRC_ENABLE_ALL_FOR_KUNIT=y diff --git a/queue-6.18/lib-crc-tests-add-a-.kunitconfig-file.patch b/queue-6.18/lib-crc-tests-add-a-.kunitconfig-file.patch new file mode 100644 index 0000000000..0eb70e857c --- /dev/null +++ b/queue-6.18/lib-crc-tests-add-a-.kunitconfig-file.patch @@ -0,0 +1,35 @@ +From stable+bounces-240239-greg=kroah.com@vger.kernel.org Tue Apr 21 23:06:57 2026 +From: Eric Biggers +Date: Tue, 21 Apr 2026 14:05:49 -0700 +Subject: lib/crc: tests: Add a .kunitconfig file +To: stable@vger.kernel.org +Cc: linux-crypto@vger.kernel.org, kunit-dev@googlegroups.com, Eric Biggers +Message-ID: <20260421210554.36096-4-ebiggers@kernel.org> + +From: Eric Biggers + +commit c13cee2fc7f137dd25ed50c63eddcc578624f204 upstream. + +Add a .kunitconfig file to the lib/crc/ directory so that the CRC +library tests can be run more easily using kunit.py. Example with UML: + + tools/testing/kunit/kunit.py run --kunitconfig=lib/crc + +Example with QEMU: + + tools/testing/kunit/kunit.py run --kunitconfig=lib/crc --arch=arm64 --make_options LLVM=1 + +Link: https://lore.kernel.org/r/20260306033557.250499-4-ebiggers@kernel.org +Signed-off-by: Eric Biggers +Signed-off-by: Greg Kroah-Hartman +--- + lib/crc/.kunitconfig | 3 +++ + 1 file changed, 3 insertions(+) + create mode 100644 lib/crc/.kunitconfig + +--- /dev/null ++++ b/lib/crc/.kunitconfig +@@ -0,0 +1,3 @@ ++CONFIG_KUNIT=y ++CONFIG_CRC_ENABLE_ALL_FOR_KUNIT=y ++CONFIG_CRC_KUNIT_TEST=y diff --git a/queue-6.18/lib-crc-tests-add-crc_enable_all_for_kunit.patch b/queue-6.18/lib-crc-tests-add-crc_enable_all_for_kunit.patch new file mode 100644 index 0000000000..e06dc96545 --- /dev/null +++ b/queue-6.18/lib-crc-tests-add-crc_enable_all_for_kunit.patch @@ -0,0 +1,47 @@ +From stable+bounces-240238-greg=kroah.com@vger.kernel.org Tue Apr 21 23:07:01 2026 +From: Eric Biggers +Date: Tue, 21 Apr 2026 14:05:48 -0700 +Subject: lib/crc: tests: Add CRC_ENABLE_ALL_FOR_KUNIT +To: stable@vger.kernel.org +Cc: linux-crypto@vger.kernel.org, kunit-dev@googlegroups.com, Eric Biggers +Message-ID: <20260421210554.36096-3-ebiggers@kernel.org> + +From: Eric Biggers + +commit cdf22aeaad8430905c3aa3b3d0f2686c65395c22 upstream. + +Now that crc_kunit uses the standard "depends on" pattern, enabling the +full set of CRC tests is a bit difficult, mainly due to CRC7 being +rarely used. Add a kconfig option to make it easier. It is visible +only when KUNIT, so hopefully the extra prompt won't be too annoying. + +Link: https://lore.kernel.org/r/20260306033557.250499-3-ebiggers@kernel.org +Signed-off-by: Eric Biggers +Signed-off-by: Greg Kroah-Hartman +--- + lib/crc/Kconfig | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +--- a/lib/crc/Kconfig ++++ b/lib/crc/Kconfig +@@ -107,6 +107,20 @@ config CRC_KUNIT_TEST + This is intended to help people writing architecture-specific + optimized versions. If unsure, say N. + ++config CRC_ENABLE_ALL_FOR_KUNIT ++ tristate "Enable all CRC functions for KUnit test" ++ depends on KUNIT ++ select CRC7 ++ select CRC16 ++ select CRC_T10DIF ++ select CRC32 ++ select CRC64 ++ help ++ Enable all CRC functions that have test code in CRC_KUNIT_TEST. ++ ++ Enable this only if you'd like the CRC KUnit test suite to test all ++ the CRC variants, even ones that wouldn't otherwise need to be built. ++ + config CRC_BENCHMARK + bool "Benchmark for the CRC functions" + depends on CRC_KUNIT_TEST diff --git a/queue-6.18/lib-crc-tests-make-crc_kunit-test-only-the-enabled-crc-variants.patch b/queue-6.18/lib-crc-tests-make-crc_kunit-test-only-the-enabled-crc-variants.patch new file mode 100644 index 0000000000..2c4846788a --- /dev/null +++ b/queue-6.18/lib-crc-tests-make-crc_kunit-test-only-the-enabled-crc-variants.patch @@ -0,0 +1,147 @@ +From stable+bounces-240237-greg=kroah.com@vger.kernel.org Tue Apr 21 23:06:52 2026 +From: Eric Biggers +Date: Tue, 21 Apr 2026 14:05:47 -0700 +Subject: lib/crc: tests: Make crc_kunit test only the enabled CRC variants +To: stable@vger.kernel.org +Cc: linux-crypto@vger.kernel.org, kunit-dev@googlegroups.com, Eric Biggers +Message-ID: <20260421210554.36096-2-ebiggers@kernel.org> + +From: Eric Biggers + +commit 85c9f3a2b805eb96d899da7bcc38a16459aa3c16 upstream. + +Like commit 4478e8eeb871 ("lib/crypto: tests: Depend on library options +rather than selecting them") did with the crypto library tests, make +crc_kunit depend on the code it tests rather than selecting it. This +follows the standard convention for KUnit and fixes an issue where +enabling KUNIT_ALL_TESTS enabled non-test code. + +crc_kunit does differ from the crypto library tests in that it +consolidates the tests for multiple CRC variants, with 5 kconfig +options, into one KUnit suite. Since depending on *all* of these +kconfig options would greatly restrict the ability to enable crc_kunit, +instead just depend on *any* of these options. Update crc_kunit +accordingly to test only the reachable code. + +Alternatively we could split crc_kunit into 5 test suites. But keeping +it as one is simpler for now. + +Fixes: e47d9b1a76ed ("lib/crc_kunit.c: add KUnit test suite for CRC library functions") +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20260306033557.250499-2-ebiggers@kernel.org +Signed-off-by: Eric Biggers +Signed-off-by: Greg Kroah-Hartman +--- + lib/crc/Kconfig | 7 +------ + lib/crc/tests/crc_kunit.c | 28 ++++++++++++++++++++++------ + 2 files changed, 23 insertions(+), 12 deletions(-) + +--- a/lib/crc/Kconfig ++++ b/lib/crc/Kconfig +@@ -99,13 +99,8 @@ config CRC_OPTIMIZATIONS + + config CRC_KUNIT_TEST + tristate "KUnit tests for CRC functions" if !KUNIT_ALL_TESTS +- depends on KUNIT ++ depends on KUNIT && (CRC7 || CRC16 || CRC_T10DIF || CRC32 || CRC64) + default KUNIT_ALL_TESTS +- select CRC7 +- select CRC16 +- select CRC_T10DIF +- select CRC32 +- select CRC64 + help + Unit tests for the CRC library functions. + +--- a/lib/crc/tests/crc_kunit.c ++++ b/lib/crc/tests/crc_kunit.c +@@ -268,8 +268,7 @@ crc_benchmark(struct kunit *test, + } + } + +-/* crc7_be */ +- ++#if IS_REACHABLE(CONFIG_CRC7) + static u64 crc7_be_wrapper(u64 crc, const u8 *p, size_t len) + { + /* +@@ -294,9 +293,9 @@ static void crc7_be_benchmark(struct kun + { + crc_benchmark(test, crc7_be_wrapper); + } ++#endif /* CONFIG_CRC7 */ + +-/* crc16 */ +- ++#if IS_REACHABLE(CONFIG_CRC16) + static u64 crc16_wrapper(u64 crc, const u8 *p, size_t len) + { + return crc16(crc, p, len); +@@ -318,9 +317,9 @@ static void crc16_benchmark(struct kunit + { + crc_benchmark(test, crc16_wrapper); + } ++#endif /* CONFIG_CRC16 */ + +-/* crc_t10dif */ +- ++#if IS_REACHABLE(CONFIG_CRC_T10DIF) + static u64 crc_t10dif_wrapper(u64 crc, const u8 *p, size_t len) + { + return crc_t10dif_update(crc, p, len); +@@ -342,6 +341,9 @@ static void crc_t10dif_benchmark(struct + { + crc_benchmark(test, crc_t10dif_wrapper); + } ++#endif /* CONFIG_CRC_T10DIF */ ++ ++#if IS_REACHABLE(CONFIG_CRC32) + + /* crc32_le */ + +@@ -414,6 +416,9 @@ static void crc32c_benchmark(struct kuni + { + crc_benchmark(test, crc32c_wrapper); + } ++#endif /* CONFIG_CRC32 */ ++ ++#if IS_REACHABLE(CONFIG_CRC64) + + /* crc64_be */ + +@@ -463,24 +468,35 @@ static void crc64_nvme_benchmark(struct + { + crc_benchmark(test, crc64_nvme_wrapper); + } ++#endif /* CONFIG_CRC64 */ + + static struct kunit_case crc_test_cases[] = { ++#if IS_REACHABLE(CONFIG_CRC7) + KUNIT_CASE(crc7_be_test), + KUNIT_CASE(crc7_be_benchmark), ++#endif ++#if IS_REACHABLE(CONFIG_CRC16) + KUNIT_CASE(crc16_test), + KUNIT_CASE(crc16_benchmark), ++#endif ++#if IS_REACHABLE(CONFIG_CRC_T10DIF) + KUNIT_CASE(crc_t10dif_test), + KUNIT_CASE(crc_t10dif_benchmark), ++#endif ++#if IS_REACHABLE(CONFIG_CRC32) + KUNIT_CASE(crc32_le_test), + KUNIT_CASE(crc32_le_benchmark), + KUNIT_CASE(crc32_be_test), + KUNIT_CASE(crc32_be_benchmark), + KUNIT_CASE(crc32c_test), + KUNIT_CASE(crc32c_benchmark), ++#endif ++#if IS_REACHABLE(CONFIG_CRC64) + KUNIT_CASE(crc64_be_test), + KUNIT_CASE(crc64_be_benchmark), + KUNIT_CASE(crc64_nvme_test), + KUNIT_CASE(crc64_nvme_benchmark), ++#endif + {}, + }; + diff --git a/queue-6.18/lib-crypto-tests-add-a-.kunitconfig-file.patch b/queue-6.18/lib-crypto-tests-add-a-.kunitconfig-file.patch new file mode 100644 index 0000000000..0957095b5c --- /dev/null +++ b/queue-6.18/lib-crypto-tests-add-a-.kunitconfig-file.patch @@ -0,0 +1,56 @@ +From stable+bounces-240241-greg=kroah.com@vger.kernel.org Tue Apr 21 23:07:18 2026 +From: Eric Biggers +Date: Tue, 21 Apr 2026 14:05:51 -0700 +Subject: lib/crypto: tests: Add a .kunitconfig file +To: stable@vger.kernel.org +Cc: linux-crypto@vger.kernel.org, kunit-dev@googlegroups.com, Eric Biggers , Ard Biesheuvel +Message-ID: <20260421210554.36096-6-ebiggers@kernel.org> + +From: Eric Biggers + +commit 20d6f07004d639967dcb00994d56ce6d16118e9e upstream. + +Add a .kunitconfig file to the lib/crypto/ directory so that the crypto +library tests can be run more easily using kunit.py. Example with UML: + + tools/testing/kunit/kunit.py run --kunitconfig=lib/crypto + +Example with QEMU: + + tools/testing/kunit/kunit.py run --kunitconfig=lib/crypto --arch=arm64 --make_options LLVM=1 + +Acked-by: Ard Biesheuvel +Link: https://lore.kernel.org/r/20260301040140.490310-1-ebiggers@kernel.org +Signed-off-by: Eric Biggers +Signed-off-by: Greg Kroah-Hartman +--- + lib/crypto/.kunitconfig | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + create mode 100644 lib/crypto/.kunitconfig + +--- /dev/null ++++ b/lib/crypto/.kunitconfig +@@ -0,0 +1,23 @@ ++CONFIG_KUNIT=y ++ ++# These kconfig options select all the CONFIG_CRYPTO_LIB_* symbols that have a ++# corresponding KUnit test. Those symbols cannot be directly enabled here, ++# since they are hidden symbols. ++CONFIG_CRYPTO=y ++CONFIG_CRYPTO_MD5=y ++CONFIG_CRYPTO_SHA1=y ++CONFIG_CRYPTO_SHA256=y ++CONFIG_CRYPTO_SHA512=y ++CONFIG_INET=y ++CONFIG_IPV6=y ++CONFIG_NET=y ++CONFIG_NETDEVICES=y ++CONFIG_WIREGUARD=y ++ ++CONFIG_CRYPTO_LIB_BLAKE2S_KUNIT_TEST=y ++CONFIG_CRYPTO_LIB_CURVE25519_KUNIT_TEST=y ++CONFIG_CRYPTO_LIB_MD5_KUNIT_TEST=y ++CONFIG_CRYPTO_LIB_POLY1305_KUNIT_TEST=y ++CONFIG_CRYPTO_LIB_SHA1_KUNIT_TEST=y ++CONFIG_CRYPTO_LIB_SHA256_KUNIT_TEST=y ++CONFIG_CRYPTO_LIB_SHA512_KUNIT_TEST=y diff --git a/queue-6.18/lib-crypto-tests-drop-the-default-to-crypto_selftests.patch b/queue-6.18/lib-crypto-tests-drop-the-default-to-crypto_selftests.patch new file mode 100644 index 0000000000..da924c8caa --- /dev/null +++ b/queue-6.18/lib-crypto-tests-drop-the-default-to-crypto_selftests.patch @@ -0,0 +1,97 @@ +From stable+bounces-240244-greg=kroah.com@vger.kernel.org Tue Apr 21 23:07:49 2026 +From: Eric Biggers +Date: Tue, 21 Apr 2026 14:05:54 -0700 +Subject: lib/crypto: tests: Drop the default to CRYPTO_SELFTESTS +To: stable@vger.kernel.org +Cc: linux-crypto@vger.kernel.org, kunit-dev@googlegroups.com, Eric Biggers , Ard Biesheuvel +Message-ID: <20260421210554.36096-9-ebiggers@kernel.org> + +From: Eric Biggers + +commit 6d80749becf8fc5ffa004194e578f79b558235ef upstream. + +Defaulting the crypto KUnit tests to KUNIT_ALL_TESTS || CRYPTO_SELFTESTS +instead of simply KUNIT_ALL_TESTS was originally intended to make it +easy to enable all the crypto KUnit tests. This additional default is +nonstandard for KUnit tests, though, and it can cause all the KUnit +tests to be built-in unexpectedly if CRYPTO_SELFTESTS is set. It also +constitutes a back-reference to crypto/ from lib/crypto/, which is +something that we should be avoiding in order to get clean layering. + +Now that we provide a lib/crypto/.kunitconfig file that enables all +crypto KUnit tests, let's consider that to be the supported way to +enable all these tests, and drop the default of CRYPTO_SELFTESTS. + +Acked-by: Ard Biesheuvel +Link: https://lore.kernel.org/r/20260317040626.5697-1-ebiggers@kernel.org +Signed-off-by: Eric Biggers +Signed-off-by: Greg Kroah-Hartman +--- + lib/crypto/tests/Kconfig | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +--- a/lib/crypto/tests/Kconfig ++++ b/lib/crypto/tests/Kconfig +@@ -3,7 +3,7 @@ + config CRYPTO_LIB_BLAKE2S_KUNIT_TEST + tristate "KUnit tests for BLAKE2s" if !KUNIT_ALL_TESTS + depends on KUNIT +- default KUNIT_ALL_TESTS || CRYPTO_SELFTESTS ++ default KUNIT_ALL_TESTS + select CRYPTO_LIB_BENCHMARK_VISIBLE + # No need to depend on CRYPTO_LIB_BLAKE2S here, as that option doesn't + # exist; the BLAKE2s code is always built-in for the /dev/random driver. +@@ -13,7 +13,7 @@ config CRYPTO_LIB_BLAKE2S_KUNIT_TEST + config CRYPTO_LIB_CURVE25519_KUNIT_TEST + tristate "KUnit tests for Curve25519" if !KUNIT_ALL_TESTS + depends on KUNIT && CRYPTO_LIB_CURVE25519 +- default KUNIT_ALL_TESTS || CRYPTO_SELFTESTS ++ default KUNIT_ALL_TESTS + select CRYPTO_LIB_BENCHMARK_VISIBLE + help + KUnit tests for the Curve25519 Diffie-Hellman function. +@@ -21,7 +21,7 @@ config CRYPTO_LIB_CURVE25519_KUNIT_TEST + config CRYPTO_LIB_MD5_KUNIT_TEST + tristate "KUnit tests for MD5" if !KUNIT_ALL_TESTS + depends on KUNIT && CRYPTO_LIB_MD5 +- default KUNIT_ALL_TESTS || CRYPTO_SELFTESTS ++ default KUNIT_ALL_TESTS + select CRYPTO_LIB_BENCHMARK_VISIBLE + help + KUnit tests for the MD5 cryptographic hash function and its +@@ -30,7 +30,7 @@ config CRYPTO_LIB_MD5_KUNIT_TEST + config CRYPTO_LIB_POLY1305_KUNIT_TEST + tristate "KUnit tests for Poly1305" if !KUNIT_ALL_TESTS + depends on KUNIT && CRYPTO_LIB_POLY1305 +- default KUNIT_ALL_TESTS || CRYPTO_SELFTESTS ++ default KUNIT_ALL_TESTS + select CRYPTO_LIB_BENCHMARK_VISIBLE + help + KUnit tests for the Poly1305 library functions. +@@ -38,7 +38,7 @@ config CRYPTO_LIB_POLY1305_KUNIT_TEST + config CRYPTO_LIB_SHA1_KUNIT_TEST + tristate "KUnit tests for SHA-1" if !KUNIT_ALL_TESTS + depends on KUNIT && CRYPTO_LIB_SHA1 +- default KUNIT_ALL_TESTS || CRYPTO_SELFTESTS ++ default KUNIT_ALL_TESTS + select CRYPTO_LIB_BENCHMARK_VISIBLE + help + KUnit tests for the SHA-1 cryptographic hash function and its +@@ -49,7 +49,7 @@ config CRYPTO_LIB_SHA1_KUNIT_TEST + config CRYPTO_LIB_SHA256_KUNIT_TEST + tristate "KUnit tests for SHA-224 and SHA-256" if !KUNIT_ALL_TESTS + depends on KUNIT && CRYPTO_LIB_SHA256 +- default KUNIT_ALL_TESTS || CRYPTO_SELFTESTS ++ default KUNIT_ALL_TESTS + select CRYPTO_LIB_BENCHMARK_VISIBLE + help + KUnit tests for the SHA-224 and SHA-256 cryptographic hash functions +@@ -60,7 +60,7 @@ config CRYPTO_LIB_SHA256_KUNIT_TEST + config CRYPTO_LIB_SHA512_KUNIT_TEST + tristate "KUnit tests for SHA-384 and SHA-512" if !KUNIT_ALL_TESTS + depends on KUNIT && CRYPTO_LIB_SHA512 +- default KUNIT_ALL_TESTS || CRYPTO_SELFTESTS ++ default KUNIT_ALL_TESTS + select CRYPTO_LIB_BENCHMARK_VISIBLE + help + KUnit tests for the SHA-384 and SHA-512 cryptographic hash functions diff --git a/queue-6.18/lib-crypto-tests-introduce-crypto_lib_enable_all_for_kunit.patch b/queue-6.18/lib-crypto-tests-introduce-crypto_lib_enable_all_for_kunit.patch new file mode 100644 index 0000000000..70dc70b345 --- /dev/null +++ b/queue-6.18/lib-crypto-tests-introduce-crypto_lib_enable_all_for_kunit.patch @@ -0,0 +1,84 @@ +From stable+bounces-240242-greg=kroah.com@vger.kernel.org Tue Apr 21 23:07:32 2026 +From: Eric Biggers +Date: Tue, 21 Apr 2026 14:05:52 -0700 +Subject: lib/crypto: tests: Introduce CRYPTO_LIB_ENABLE_ALL_FOR_KUNIT +To: stable@vger.kernel.org +Cc: linux-crypto@vger.kernel.org, kunit-dev@googlegroups.com, Eric Biggers +Message-ID: <20260421210554.36096-7-ebiggers@kernel.org> + +From: Eric Biggers + +commit ed1767442d919f57aaf83d69c33853da2644d902 upstream. + +For kunit.py to run all the crypto library tests when passed the +--alltests option, tools/testing/kunit/configs/all_tests.config needs to +enable options that satisfy the test dependencies. + +This is the same as what lib/crypto/.kunitconfig already does. +However, the strategy that lib/crypto/.kunitconfig currently uses to +select all the hidden library options isn't going to scale up well when +it needs to be repeated in two places. + +Instead let's go ahead and introduce an option +CRYPTO_LIB_ENABLE_ALL_FOR_KUNIT that depends on KUNIT and selects all +the crypto library options that have corresponding KUnit tests. + +Update lib/crypto/.kunitconfig to use this option. + +Link: https://lore.kernel.org/r/20260314035927.51351-2-ebiggers@kernel.org +Signed-off-by: Eric Biggers +Signed-off-by: Greg Kroah-Hartman +--- + lib/crypto/.kunitconfig | 14 +------------- + lib/crypto/tests/Kconfig | 18 ++++++++++++++++++ + 2 files changed, 19 insertions(+), 13 deletions(-) + +--- a/lib/crypto/.kunitconfig ++++ b/lib/crypto/.kunitconfig +@@ -1,18 +1,6 @@ + CONFIG_KUNIT=y + +-# These kconfig options select all the CONFIG_CRYPTO_LIB_* symbols that have a +-# corresponding KUnit test. Those symbols cannot be directly enabled here, +-# since they are hidden symbols. +-CONFIG_CRYPTO=y +-CONFIG_CRYPTO_MD5=y +-CONFIG_CRYPTO_SHA1=y +-CONFIG_CRYPTO_SHA256=y +-CONFIG_CRYPTO_SHA512=y +-CONFIG_INET=y +-CONFIG_IPV6=y +-CONFIG_NET=y +-CONFIG_NETDEVICES=y +-CONFIG_WIREGUARD=y ++CONFIG_CRYPTO_LIB_ENABLE_ALL_FOR_KUNIT=y + + CONFIG_CRYPTO_LIB_BLAKE2S_KUNIT_TEST=y + CONFIG_CRYPTO_LIB_CURVE25519_KUNIT_TEST=y +--- a/lib/crypto/tests/Kconfig ++++ b/lib/crypto/tests/Kconfig +@@ -66,6 +66,24 @@ config CRYPTO_LIB_SHA512_KUNIT_TEST + KUnit tests for the SHA-384 and SHA-512 cryptographic hash functions + and their corresponding HMACs. + ++config CRYPTO_LIB_ENABLE_ALL_FOR_KUNIT ++ tristate "Enable all crypto library code for KUnit tests" ++ depends on KUNIT ++ select CRYPTO_LIB_CURVE25519 ++ select CRYPTO_LIB_MD5 ++ select CRYPTO_LIB_POLY1305 ++ select CRYPTO_LIB_SHA1 ++ select CRYPTO_LIB_SHA256 ++ select CRYPTO_LIB_SHA512 ++ help ++ Enable all the crypto library code that has KUnit tests. ++ ++ Enable this only if you'd like to test all the crypto library code, ++ even code that wouldn't otherwise need to be built. ++ ++ You'll still need to enable the tests themselves, either individually ++ or using KUNIT_ALL_TESTS. ++ + config CRYPTO_LIB_BENCHMARK_VISIBLE + bool + diff --git a/queue-6.18/sched-debug-fix-avg_vruntime-usage.patch b/queue-6.18/sched-debug-fix-avg_vruntime-usage.patch new file mode 100644 index 0000000000..a6e3f63e78 --- /dev/null +++ b/queue-6.18/sched-debug-fix-avg_vruntime-usage.patch @@ -0,0 +1,59 @@ +From e08d007f9d813616ce7093600bc4fdb9c9d81d89 Mon Sep 17 00:00:00 2001 +From: Peter Zijlstra +Date: Wed, 1 Apr 2026 15:20:21 +0200 +Subject: sched/debug: Fix avg_vruntime() usage + +From: Peter Zijlstra + +commit e08d007f9d813616ce7093600bc4fdb9c9d81d89 upstream. + +John reported that stress-ng-yield could make his machine unhappy and +managed to bisect it to commit b3d99f43c72b ("sched/fair: Fix +zero_vruntime tracking"). + +The commit in question changes avg_vruntime() from a function that is +a pure reader, to a function that updates variables. This turns an +unlocked sched/debug usage of this function from a minor mistake into +a data corruptor. + +Fixes: af4cf40470c2 ("sched/fair: Add cfs_rq::avg_vruntime") +Fixes: b3d99f43c72b ("sched/fair: Fix zero_vruntime tracking") +Reported-by: John Stultz +Signed-off-by: Peter Zijlstra (Intel) +Reviewed-by: Vincent Guittot +Tested-by: K Prateek Nayak +Tested-by: John Stultz +Link: https://patch.msgid.link/20260401132355.196370805@infradead.org +Signed-off-by: John Stultz +Signed-off-by: Greg Kroah-Hartman +--- + kernel/sched/debug.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/kernel/sched/debug.c ++++ b/kernel/sched/debug.c +@@ -798,6 +798,7 @@ static void print_rq(struct seq_file *m, + void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) + { + s64 left_vruntime = -1, zero_vruntime, right_vruntime = -1, left_deadline = -1, spread; ++ u64 avruntime; + struct sched_entity *last, *first, *root; + struct rq *rq = cpu_rq(cpu); + unsigned long flags; +@@ -821,6 +822,7 @@ void print_cfs_rq(struct seq_file *m, in + if (last) + right_vruntime = last->vruntime; + zero_vruntime = cfs_rq->zero_vruntime; ++ avruntime = avg_vruntime(cfs_rq); + raw_spin_rq_unlock_irqrestore(rq, flags); + + SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "left_deadline", +@@ -830,7 +832,7 @@ void print_cfs_rq(struct seq_file *m, in + SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "zero_vruntime", + SPLIT_NS(zero_vruntime)); + SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "avg_vruntime", +- SPLIT_NS(avg_vruntime(cfs_rq))); ++ SPLIT_NS(avruntime)); + SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "right_vruntime", + SPLIT_NS(right_vruntime)); + spread = right_vruntime - left_vruntime; diff --git a/queue-6.18/series b/queue-6.18/series index debd49f279..aea2b94251 100644 --- a/queue-6.18/series +++ b/queue-6.18/series @@ -13,3 +13,12 @@ arm64-tlb-introduce-__tlbi_sync_s1ish_-kernel-batch-for-tlb-maintenance.patch arm64-tlb-pass-the-corresponding-mm-to-__tlbi_sync_s1ish.patch arm64-cputype-add-c1-pro-definitions.patch arm64-errata-work-around-early-cme-dvmsync-acknowledgement.patch +sched-debug-fix-avg_vruntime-usage.patch +lib-crc-tests-make-crc_kunit-test-only-the-enabled-crc-variants.patch +lib-crc-tests-add-crc_enable_all_for_kunit.patch +lib-crc-tests-add-a-.kunitconfig-file.patch +kunit-configs-enable-all-crc-tests-in-all_tests.config.patch +lib-crypto-tests-add-a-.kunitconfig-file.patch +lib-crypto-tests-introduce-crypto_lib_enable_all_for_kunit.patch +kunit-configs-enable-all-crypto-library-tests-in-all_tests.config.patch +lib-crypto-tests-drop-the-default-to-crypto_selftests.patch