crypto: cryptomgr - Select algorithm types only when CRYPTO_SELFTESTS
PATCH v2 1/1 crypto: cryptomgr - Select algorithm types only when CRYPTO_SELFTESTS
Enabling any template selects CRYPTO_MANAGER, which causes CRYPTO_MANAGER2 to enable itself, which selects every algorithm type option. However, pulling in all algorithm types is needed only when the self-tests are enabled. So condition the selections accordingly.
To make this possible, also add the missing selections to various symbols that were relying on transitive selections via CRYPTO_MANAGER.
---
This patch is targeting cryptodev/master
v2: add selections to options that were relying on transitive selection
crypto/Kconfig | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-)
crypto/Kconfig +18 -8
@@ -155,18 +155,18 @@ config CRYPTO_MANAGER This provides the support for instantiating templates such as cbc(aes), and the support for the crypto self-tests. config CRYPTO_MANAGER2 def_tristate CRYPTO_MANAGER || (CRYPTO_MANAGER!=n && CRYPTO_ALGAPI=y) - select CRYPTO_ACOMP2 - select CRYPTO_AEAD2 - select CRYPTO_AKCIPHER2 - select CRYPTO_SIG2 - select CRYPTO_HASH2 - select CRYPTO_KPP2 - select CRYPTO_RNG2 - select CRYPTO_SKCIPHER2 + select CRYPTO_ACOMP2 if CRYPTO_SELFTESTS + select CRYPTO_AEAD2 if CRYPTO_SELFTESTS + select CRYPTO_AKCIPHER2 if CRYPTO_SELFTESTS + select CRYPTO_SIG2 if CRYPTO_SELFTESTS + select CRYPTO_HASH2 if CRYPTO_SELFTESTS + select CRYPTO_KPP2 if CRYPTO_SELFTESTS + select CRYPTO_RNG2 if CRYPTO_SELFTESTS + select CRYPTO_SKCIPHER2 if CRYPTO_SELFTESTS config CRYPTO_USER tristate "Userspace cryptographic algorithm configuration" depends on NET select CRYPTO_MANAGER
@@ -222,10 +222,11 @@ config CRYPTO_PCRYPT This converts an arbitrary crypto algorithm into a parallel algorithm that executes in kernel threads. config CRYPTO_CRYPTD tristate "Software async crypto daemon" + select CRYPTO_AEAD select CRYPTO_SKCIPHER select CRYPTO_HASH select CRYPTO_MANAGER help This is a generic software asynchronous crypto daemon that
@@ -255,24 +256,33 @@ config CRYPTO_KRB5ENC sunrpc/NFS and rxrpc/AFS. config CRYPTO_BENCHMARK tristate "Crypto benchmarking module" depends on m || EXPERT + select CRYPTO_AEAD + select CRYPTO_HASH select CRYPTO_MANAGER + select CRYPTO_SKCIPHER help Quick & dirty crypto benchmarking module. This is mainly intended for use by people developing cryptographic algorithms in the kernel. It should not be enabled in production kernels. config CRYPTO_SIMD tristate + select CRYPTO_AEAD select CRYPTO_CRYPTD config CRYPTO_ENGINE tristate + select CRYPTO_AEAD + select CRYPTO_AKCIPHER + select CRYPTO_HASH + select CRYPTO_KPP + select CRYPTO_SKCIPHER endmenu menu "Public-key cryptography"
base-commit: f9bbd547cfb98b1c5e535aab9b0671a2ff22453a
Signature · 1 line
2.53.0
kernel test robot
build botkernel test robot noticed the following build errors:
Hi Eric,
kernel test robot noticed the following build errors:
[auto build test ERROR on f9bbd547cfb98b1c5e535aab9b0671a2ff22453a]
url: https://github.com/intel-lab-lkp/linux/commits/Eric-Biggers/crypto-cryptomgr-Select-algorithm-types-only-when-CRYPTO_SELFTESTS/20260324-131705 base: f9bbd547cfb98b1c5e535aab9b0671a2ff22453a patch link: https://lore.kernel.org/r/20260324050123.9494-1-ebiggers%40kernel.org patch subject: [PATCH v2] crypto: cryptomgr - Select algorithm types only when CRYPTO_SELFTESTS config: sparc-randconfig-002-20260325 (https://download.01.org/0day-ci/archive/20260325/[email protected]/config) compiler: sparc-linux-gcc (GCC) 14.3.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260325/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
sparc-linux-ld: drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.o: in function `sun8i_ce_unregister_algs':
>> sun8i-ce-core.c:(.text+0x19c): undefined reference to `crypto_unregister_rng' sparc-linux-ld: drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.o: in function `sun8i_ce_register_algs': >> sun8i-ce-core.c:(.text+0x654): undefined reference to `crypto_register_rng'
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
kernel test robot
build botkernel test robot noticed the following build errors:
Hi Eric,
kernel test robot noticed the following build errors:
[auto build test ERROR on f9bbd547cfb98b1c5e535aab9b0671a2ff22453a]
url: https://github.com/intel-lab-lkp/linux/commits/Eric-Biggers/crypto-cryptomgr-Select-algorithm-types-only-when-CRYPTO_SELFTESTS/20260324-131705 base: f9bbd547cfb98b1c5e535aab9b0671a2ff22453a patch link: https://lore.kernel.org/r/20260324050123.9494-1-ebiggers%40kernel.org patch subject: [PATCH v2] crypto: cryptomgr - Select algorithm types only when CRYPTO_SELFTESTS config: i386-randconfig-053-20260325 (https://download.01.org/0day-ci/archive/20260325/[email protected]/config) compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260325/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
>> ld.lld: error: undefined symbol: crypto_register_acomps >>> referenced by qat_comp_algs.c:258 (drivers/crypto/intel/qat/qat_common/qat_comp_algs.c:258) >>> drivers/crypto/intel/qat/qat_common/qat_comp_algs.o:(qat_comp_algs_register) in archive vmlinux.a -- >> ld.lld: error: undefined symbol: crypto_unregister_acomps >>> referenced by qat_comp_algs.c:267 (drivers/crypto/intel/qat/qat_common/qat_comp_algs.c:267) >>> drivers/crypto/intel/qat/qat_common/qat_comp_algs.o:(qat_comp_algs_unregister) in archive vmlinux.a
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki