crypto: run initcalls for generic implementations earlier
Use subsys_initcall for registration of all templates and generic algorithm implementations, rather than module_init. Then change cryptomgr to use arch_initcall, to place it before the subsys_initcalls. This is needed so that when both a generic and optimized implementation of an algorithm are built into the kernel (not loadable modules), the generic implementation is registered before the optimized one. Otherwise, the self-tests for the optimized implementation are unable to allocate the generic implementation for the new comparison fuzz tests. Note that on arm, a side effect of this change is that self-tests for generic implementations may run before the unaligned access handler has been installed. So, unaligned accesses will crash the kernel. This is arguably a good thing as it makes it easier to detect that type of bug. Signed-off-by:Eric Biggers <ebiggers@google.com> Signed-off-by:
Herbert Xu <herbert@gondor.apana.org.au>
Showing
- crypto/842.c 1 addition, 1 deletioncrypto/842.c
- crypto/adiantum.c 1 addition, 1 deletioncrypto/adiantum.c
- crypto/aegis128.c 1 addition, 1 deletioncrypto/aegis128.c
- crypto/aegis128l.c 1 addition, 1 deletioncrypto/aegis128l.c
- crypto/aegis256.c 1 addition, 1 deletioncrypto/aegis256.c
- crypto/aes_generic.c 1 addition, 1 deletioncrypto/aes_generic.c
- crypto/algboss.c 7 additions, 1 deletioncrypto/algboss.c
- crypto/ansi_cprng.c 1 addition, 1 deletioncrypto/ansi_cprng.c
- crypto/anubis.c 1 addition, 1 deletioncrypto/anubis.c
- crypto/arc4.c 1 addition, 1 deletioncrypto/arc4.c
- crypto/authenc.c 1 addition, 1 deletioncrypto/authenc.c
- crypto/authencesn.c 1 addition, 1 deletioncrypto/authencesn.c
- crypto/blowfish_generic.c 1 addition, 1 deletioncrypto/blowfish_generic.c
- crypto/camellia_generic.c 1 addition, 1 deletioncrypto/camellia_generic.c
- crypto/cast5_generic.c 1 addition, 1 deletioncrypto/cast5_generic.c
- crypto/cast6_generic.c 1 addition, 1 deletioncrypto/cast6_generic.c
- crypto/cbc.c 1 addition, 1 deletioncrypto/cbc.c
- crypto/ccm.c 1 addition, 1 deletioncrypto/ccm.c
- crypto/cfb.c 1 addition, 1 deletioncrypto/cfb.c
- crypto/chacha20poly1305.c 1 addition, 1 deletioncrypto/chacha20poly1305.c
Loading
Please register or sign in to comment