]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
crypto: run initcalls for generic implementations earlier
authorEric Biggers <ebiggers@google.com>
Fri, 12 Apr 2019 04:57:42 +0000 (21:57 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 18 Apr 2019 14:15:03 +0000 (22:15 +0800)
commitc4741b23059794bd99beef0f700103b0d983b3fd
tree8db3440418a9c3ed32d57c2c2a35340479d3cc44
parent40153b10d91c9e25f912344ba6ce1f0874400659
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>
83 files changed:
crypto/842.c
crypto/adiantum.c
crypto/aegis128.c
crypto/aegis128l.c
crypto/aegis256.c
crypto/aes_generic.c
crypto/algboss.c
crypto/ansi_cprng.c
crypto/anubis.c
crypto/arc4.c
crypto/authenc.c
crypto/authencesn.c
crypto/blowfish_generic.c
crypto/camellia_generic.c
crypto/cast5_generic.c
crypto/cast6_generic.c
crypto/cbc.c
crypto/ccm.c
crypto/cfb.c
crypto/chacha20poly1305.c
crypto/chacha_generic.c
crypto/cmac.c
crypto/crc32_generic.c
crypto/crc32c_generic.c
crypto/crct10dif_generic.c
crypto/crypto_null.c
crypto/ctr.c
crypto/cts.c
crypto/deflate.c
crypto/des_generic.c
crypto/dh.c
crypto/drbg.c
crypto/ecb.c
crypto/ecdh.c
crypto/echainiv.c
crypto/fcrypt.c
crypto/fips.c
crypto/gcm.c
crypto/ghash-generic.c
crypto/hmac.c
crypto/jitterentropy-kcapi.c
crypto/keywrap.c
crypto/khazad.c
crypto/lrw.c
crypto/lz4.c
crypto/lz4hc.c
crypto/lzo-rle.c
crypto/lzo.c
crypto/md4.c
crypto/md5.c
crypto/michael_mic.c
crypto/morus1280.c
crypto/morus640.c
crypto/nhpoly1305.c
crypto/ofb.c
crypto/pcbc.c
crypto/pcrypt.c
crypto/poly1305_generic.c
crypto/rmd128.c
crypto/rmd160.c
crypto/rmd256.c
crypto/rmd320.c
crypto/rsa.c
crypto/salsa20_generic.c
crypto/seed.c
crypto/seqiv.c
crypto/serpent_generic.c
crypto/sha1_generic.c
crypto/sha256_generic.c
crypto/sha3_generic.c
crypto/sha512_generic.c
crypto/sm3_generic.c
crypto/sm4_generic.c
crypto/streebog_generic.c
crypto/tcrypt.c
crypto/tea.c
crypto/tgr192.c
crypto/twofish_generic.c
crypto/vmac.c
crypto/wp512.c
crypto/xcbc.c
crypto/xts.c
crypto/zstd.c