OSDN Git Service

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)
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

index bc26dc9..5f98393 100644 (file)
@@ -144,7 +144,7 @@ static int __init crypto842_mod_init(void)
 
        return ret;
 }
-module_init(crypto842_mod_init);
+subsys_initcall(crypto842_mod_init);
 
 static void __exit crypto842_mod_exit(void)
 {
index 5564e73..e6de50f 100644 (file)
@@ -659,7 +659,7 @@ static void __exit adiantum_module_exit(void)
        crypto_unregister_template(&adiantum_tmpl);
 }
 
-module_init(adiantum_module_init);
+subsys_initcall(adiantum_module_init);
 module_exit(adiantum_module_exit);
 
 MODULE_DESCRIPTION("Adiantum length-preserving encryption mode");
index 3718a83..d78f77f 100644 (file)
@@ -448,7 +448,7 @@ static void __exit crypto_aegis128_module_exit(void)
        crypto_unregister_aead(&crypto_aegis128_alg);
 }
 
-module_init(crypto_aegis128_module_init);
+subsys_initcall(crypto_aegis128_module_init);
 module_exit(crypto_aegis128_module_exit);
 
 MODULE_LICENSE("GPL");
index 275a861..9bca3d6 100644 (file)
@@ -512,7 +512,7 @@ static void __exit crypto_aegis128l_module_exit(void)
        crypto_unregister_aead(&crypto_aegis128l_alg);
 }
 
-module_init(crypto_aegis128l_module_init);
+subsys_initcall(crypto_aegis128l_module_init);
 module_exit(crypto_aegis128l_module_exit);
 
 MODULE_LICENSE("GPL");
index ecd6b7f..b47fd39 100644 (file)
@@ -463,7 +463,7 @@ static void __exit crypto_aegis256_module_exit(void)
        crypto_unregister_aead(&crypto_aegis256_alg);
 }
 
-module_init(crypto_aegis256_module_init);
+subsys_initcall(crypto_aegis256_module_init);
 module_exit(crypto_aegis256_module_exit);
 
 MODULE_LICENSE("GPL");
index fddcbe3..f217568 100644 (file)
@@ -1470,7 +1470,7 @@ static void __exit aes_fini(void)
        crypto_unregister_alg(&aes_alg);
 }
 
-module_init(aes_init);
+subsys_initcall(aes_init);
 module_exit(aes_fini);
 
 MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm");
index 527b44d..bb97cfb 100644 (file)
@@ -296,7 +296,13 @@ static void __exit cryptomgr_exit(void)
        BUG_ON(err);
 }
 
-subsys_initcall(cryptomgr_init);
+/*
+ * This is arch_initcall() so that the crypto self-tests are run on algorithms
+ * registered early by subsys_initcall().  subsys_initcall() is needed for
+ * generic implementations so that they're available for comparison tests when
+ * other implementations are registered later by module_init().
+ */
+arch_initcall(cryptomgr_init);
 module_exit(cryptomgr_exit);
 
 MODULE_LICENSE("GPL");
index eff337c..e7c43ea 100644 (file)
@@ -472,7 +472,7 @@ MODULE_DESCRIPTION("Software Pseudo Random Number Generator");
 MODULE_AUTHOR("Neil Horman <nhorman@tuxdriver.com>");
 module_param(dbg, int, 0);
 MODULE_PARM_DESC(dbg, "Boolean to enable debugging (0/1 == off/on)");
-module_init(prng_mod_init);
+subsys_initcall(prng_mod_init);
 module_exit(prng_mod_fini);
 MODULE_ALIAS_CRYPTO("stdrng");
 MODULE_ALIAS_CRYPTO("ansi_cprng");
index 4bb187c..673927d 100644 (file)
@@ -699,7 +699,7 @@ static void __exit anubis_mod_fini(void)
        crypto_unregister_alg(&anubis_alg);
 }
 
-module_init(anubis_mod_init);
+subsys_initcall(anubis_mod_init);
 module_exit(anubis_mod_fini);
 
 MODULE_LICENSE("GPL");
index 6c93342..2233d36 100644 (file)
@@ -163,7 +163,7 @@ static void __exit arc4_exit(void)
        crypto_unregister_skcipher(&arc4_skcipher);
 }
 
-module_init(arc4_init);
+subsys_initcall(arc4_init);
 module_exit(arc4_exit);
 
 MODULE_LICENSE("GPL");
index 4be293a..b3eddac 100644 (file)
@@ -508,7 +508,7 @@ static void __exit crypto_authenc_module_exit(void)
        crypto_unregister_template(&crypto_authenc_tmpl);
 }
 
-module_init(crypto_authenc_module_init);
+subsys_initcall(crypto_authenc_module_init);
 module_exit(crypto_authenc_module_exit);
 
 MODULE_LICENSE("GPL");
index 4741fe8..5807430 100644 (file)
@@ -523,7 +523,7 @@ static void __exit crypto_authenc_esn_module_exit(void)
        crypto_unregister_template(&crypto_authenc_esn_tmpl);
 }
 
-module_init(crypto_authenc_esn_module_init);
+subsys_initcall(crypto_authenc_esn_module_init);
 module_exit(crypto_authenc_esn_module_exit);
 
 MODULE_LICENSE("GPL");
index 87b392a..8548ced 100644 (file)
@@ -133,7 +133,7 @@ static void __exit blowfish_mod_fini(void)
        crypto_unregister_alg(&alg);
 }
 
-module_init(blowfish_mod_init);
+subsys_initcall(blowfish_mod_init);
 module_exit(blowfish_mod_fini);
 
 MODULE_LICENSE("GPL");
index 32ddd48..15ce128 100644 (file)
@@ -1092,7 +1092,7 @@ static void __exit camellia_fini(void)
        crypto_unregister_alg(&camellia_alg);
 }
 
-module_init(camellia_init);
+subsys_initcall(camellia_init);
 module_exit(camellia_fini);
 
 MODULE_DESCRIPTION("Camellia Cipher Algorithm");
index 66169c1..24bc7d4 100644 (file)
@@ -543,7 +543,7 @@ static void __exit cast5_mod_fini(void)
        crypto_unregister_alg(&alg);
 }
 
-module_init(cast5_mod_init);
+subsys_initcall(cast5_mod_init);
 module_exit(cast5_mod_fini);
 
 MODULE_LICENSE("GPL");
index c8e5ec6..edd59cc 100644 (file)
@@ -285,7 +285,7 @@ static void __exit cast6_mod_fini(void)
        crypto_unregister_alg(&alg);
 }
 
-module_init(cast6_mod_init);
+subsys_initcall(cast6_mod_init);
 module_exit(cast6_mod_fini);
 
 MODULE_LICENSE("GPL");
index d12efaa..129f79d 100644 (file)
@@ -98,7 +98,7 @@ static void __exit crypto_cbc_module_exit(void)
        crypto_unregister_template(&crypto_cbc_tmpl);
 }
 
-module_init(crypto_cbc_module_init);
+subsys_initcall(crypto_cbc_module_init);
 module_exit(crypto_cbc_module_exit);
 
 MODULE_LICENSE("GPL");
index 50df8f0..3d036df 100644 (file)
@@ -1014,7 +1014,7 @@ static void __exit crypto_ccm_module_exit(void)
                                    ARRAY_SIZE(crypto_ccm_tmpls));
 }
 
-module_init(crypto_ccm_module_init);
+subsys_initcall(crypto_ccm_module_init);
 module_exit(crypto_ccm_module_exit);
 
 MODULE_LICENSE("GPL");
index 03ac847..7b68fbb 100644 (file)
@@ -243,7 +243,7 @@ static void __exit crypto_cfb_module_exit(void)
        crypto_unregister_template(&crypto_cfb_tmpl);
 }
 
-module_init(crypto_cfb_module_init);
+subsys_initcall(crypto_cfb_module_init);
 module_exit(crypto_cfb_module_exit);
 
 MODULE_LICENSE("GPL");
index 279d816..e38a2d6 100644 (file)
@@ -725,7 +725,7 @@ static void __exit chacha20poly1305_module_exit(void)
                                    ARRAY_SIZE(rfc7539_tmpls));
 }
 
-module_init(chacha20poly1305_module_init);
+subsys_initcall(chacha20poly1305_module_init);
 module_exit(chacha20poly1305_module_exit);
 
 MODULE_LICENSE("GPL");
index a7fae9b..d2ec049 100644 (file)
@@ -201,7 +201,7 @@ static void __exit chacha_generic_mod_fini(void)
        crypto_unregister_skciphers(algs, ARRAY_SIZE(algs));
 }
 
-module_init(chacha_generic_mod_init);
+subsys_initcall(chacha_generic_mod_init);
 module_exit(chacha_generic_mod_fini);
 
 MODULE_LICENSE("GPL");
index 16301f5..c60b6c0 100644 (file)
@@ -313,7 +313,7 @@ static void __exit crypto_cmac_module_exit(void)
        crypto_unregister_template(&crypto_cmac_tmpl);
 }
 
-module_init(crypto_cmac_module_init);
+subsys_initcall(crypto_cmac_module_init);
 module_exit(crypto_cmac_module_exit);
 
 MODULE_LICENSE("GPL");
index 00facd2..9e97912 100644 (file)
@@ -146,7 +146,7 @@ static void __exit crc32_mod_fini(void)
        crypto_unregister_shash(&alg);
 }
 
-module_init(crc32_mod_init);
+subsys_initcall(crc32_mod_init);
 module_exit(crc32_mod_fini);
 
 MODULE_AUTHOR("Alexander Boyko <alexander_boyko@xyratex.com>");
index 7283066..ad26f15 100644 (file)
@@ -165,7 +165,7 @@ static void __exit crc32c_mod_fini(void)
        crypto_unregister_shash(&alg);
 }
 
-module_init(crc32c_mod_init);
+subsys_initcall(crc32c_mod_init);
 module_exit(crc32c_mod_fini);
 
 MODULE_AUTHOR("Clay Haapala <chaapala@cisco.com>");
index d08048a..d90c007 100644 (file)
@@ -112,7 +112,7 @@ static void __exit crct10dif_mod_fini(void)
        crypto_unregister_shash(&alg);
 }
 
-module_init(crct10dif_mod_init);
+subsys_initcall(crct10dif_mod_init);
 module_exit(crct10dif_mod_fini);
 
 MODULE_AUTHOR("Tim Chen <tim.c.chen@linux.intel.com>");
index 01630a9..9320d4e 100644 (file)
@@ -220,7 +220,7 @@ static void __exit crypto_null_mod_fini(void)
        crypto_unregister_skcipher(&skcipher_null);
 }
 
-module_init(crypto_null_mod_init);
+subsys_initcall(crypto_null_mod_init);
 module_exit(crypto_null_mod_fini);
 
 MODULE_LICENSE("GPL");
index ec8f8b6..52cdf2c 100644 (file)
@@ -384,7 +384,7 @@ static void __exit crypto_ctr_module_exit(void)
                                    ARRAY_SIZE(crypto_ctr_tmpls));
 }
 
-module_init(crypto_ctr_module_init);
+subsys_initcall(crypto_ctr_module_init);
 module_exit(crypto_ctr_module_exit);
 
 MODULE_LICENSE("GPL");
index 9441da7..6b6087d 100644 (file)
@@ -423,7 +423,7 @@ static void __exit crypto_cts_module_exit(void)
        crypto_unregister_template(&crypto_cts_tmpl);
 }
 
-module_init(crypto_cts_module_init);
+subsys_initcall(crypto_cts_module_init);
 module_exit(crypto_cts_module_exit);
 
 MODULE_LICENSE("Dual BSD/GPL");
index 94ec3b3..aab089c 100644 (file)
@@ -334,7 +334,7 @@ static void __exit deflate_mod_fini(void)
        crypto_unregister_scomps(scomp, ARRAY_SIZE(scomp));
 }
 
-module_init(deflate_mod_init);
+subsys_initcall(deflate_mod_init);
 module_exit(deflate_mod_fini);
 
 MODULE_LICENSE("GPL");
index ebec1fb..d7a88b4 100644 (file)
@@ -990,7 +990,7 @@ static void __exit des_generic_mod_fini(void)
        crypto_unregister_algs(des_algs, ARRAY_SIZE(des_algs));
 }
 
-module_init(des_generic_mod_init);
+subsys_initcall(des_generic_mod_init);
 module_exit(des_generic_mod_fini);
 
 MODULE_LICENSE("GPL");
index 09a44de..ce77fb4 100644 (file)
@@ -236,7 +236,7 @@ static void dh_exit(void)
        crypto_unregister_kpp(&dh);
 }
 
-module_init(dh_init);
+subsys_initcall(dh_init);
 module_exit(dh_exit);
 MODULE_ALIAS_CRYPTO("dh");
 MODULE_LICENSE("GPL");
index bc52d95..710b304 100644 (file)
@@ -2039,7 +2039,7 @@ static void __exit drbg_exit(void)
        crypto_unregister_rngs(drbg_algs, (ARRAY_SIZE(drbg_cores) * 2));
 }
 
-module_init(drbg_init);
+subsys_initcall(drbg_init);
 module_exit(drbg_exit);
 #ifndef CRYPTO_DRBG_HASH_STRING
 #define CRYPTO_DRBG_HASH_STRING ""
index 0732715..de83912 100644 (file)
@@ -101,7 +101,7 @@ static void __exit crypto_ecb_module_exit(void)
        crypto_unregister_template(&crypto_ecb_tmpl);
 }
 
-module_init(crypto_ecb_module_init);
+subsys_initcall(crypto_ecb_module_init);
 module_exit(crypto_ecb_module_exit);
 
 MODULE_LICENSE("GPL");
index bf63001..890092b 100644 (file)
@@ -166,7 +166,7 @@ static void ecdh_exit(void)
        crypto_unregister_kpp(&ecdh);
 }
 
-module_init(ecdh_init);
+subsys_initcall(ecdh_init);
 module_exit(ecdh_exit);
 MODULE_ALIAS_CRYPTO("ecdh");
 MODULE_LICENSE("GPL");
index 77e607f..e71d1bc 100644 (file)
@@ -174,7 +174,7 @@ static void __exit echainiv_module_exit(void)
        crypto_unregister_template(&echainiv_tmpl);
 }
 
-module_init(echainiv_module_init);
+subsys_initcall(echainiv_module_init);
 module_exit(echainiv_module_exit);
 
 MODULE_LICENSE("GPL");
index 77286ea..4e87044 100644 (file)
@@ -414,7 +414,7 @@ static void __exit fcrypt_mod_fini(void)
        crypto_unregister_alg(&fcrypt_alg);
 }
 
-module_init(fcrypt_mod_init);
+subsys_initcall(fcrypt_mod_init);
 module_exit(fcrypt_mod_fini);
 
 MODULE_LICENSE("Dual BSD/GPL");
index 9d627c1..9dfed12 100644 (file)
@@ -74,5 +74,5 @@ static void __exit fips_exit(void)
        crypto_proc_fips_exit();
 }
 
-module_init(fips_init);
+subsys_initcall(fips_init);
 module_exit(fips_exit);
index e1a11f5..ff49841 100644 (file)
@@ -1258,7 +1258,7 @@ static void __exit crypto_gcm_module_exit(void)
                                    ARRAY_SIZE(crypto_gcm_tmpls));
 }
 
-module_init(crypto_gcm_module_init);
+subsys_initcall(crypto_gcm_module_init);
 module_exit(crypto_gcm_module_exit);
 
 MODULE_LICENSE("GPL");
index d9f192b..e630793 100644 (file)
@@ -149,7 +149,7 @@ static void __exit ghash_mod_exit(void)
        crypto_unregister_shash(&ghash_alg);
 }
 
-module_init(ghash_mod_init);
+subsys_initcall(ghash_mod_init);
 module_exit(ghash_mod_exit);
 
 MODULE_LICENSE("GPL");
index e747302..4ceb3f1 100644 (file)
@@ -268,7 +268,7 @@ static void __exit hmac_module_exit(void)
        crypto_unregister_template(&hmac_tmpl);
 }
 
-module_init(hmac_module_init);
+subsys_initcall(hmac_module_init);
 module_exit(hmac_module_exit);
 
 MODULE_LICENSE("GPL");
index 787dccc..6ea1a27 100644 (file)
@@ -198,7 +198,7 @@ static void __exit jent_mod_exit(void)
        crypto_unregister_rng(&jent_alg);
 }
 
-module_init(jent_mod_init);
+subsys_initcall(jent_mod_init);
 module_exit(jent_mod_exit);
 
 MODULE_LICENSE("Dual BSD/GPL");
index a5cfe61..a155c88 100644 (file)
@@ -310,7 +310,7 @@ static void __exit crypto_kw_exit(void)
        crypto_unregister_template(&crypto_kw_tmpl);
 }
 
-module_init(crypto_kw_init);
+subsys_initcall(crypto_kw_init);
 module_exit(crypto_kw_exit);
 
 MODULE_LICENSE("Dual BSD/GPL");
index 873eb5d..b50aa8a 100644 (file)
@@ -875,7 +875,7 @@ static void __exit khazad_mod_fini(void)
 }
 
 
-module_init(khazad_mod_init);
+subsys_initcall(khazad_mod_init);
 module_exit(khazad_mod_fini);
 
 MODULE_LICENSE("GPL");
index b6666c5..0cc689a 100644 (file)
@@ -433,7 +433,7 @@ static void __exit crypto_module_exit(void)
        crypto_unregister_template(&crypto_tmpl);
 }
 
-module_init(crypto_module_init);
+subsys_initcall(crypto_module_init);
 module_exit(crypto_module_exit);
 
 MODULE_LICENSE("GPL");
index c160dfd..1e35134 100644 (file)
@@ -164,7 +164,7 @@ static void __exit lz4_mod_fini(void)
        crypto_unregister_scomp(&scomp);
 }
 
-module_init(lz4_mod_init);
+subsys_initcall(lz4_mod_init);
 module_exit(lz4_mod_fini);
 
 MODULE_LICENSE("GPL");
index 583b5e0..4a220b6 100644 (file)
@@ -165,7 +165,7 @@ static void __exit lz4hc_mod_fini(void)
        crypto_unregister_scomp(&scomp);
 }
 
-module_init(lz4hc_mod_init);
+subsys_initcall(lz4hc_mod_init);
 module_exit(lz4hc_mod_fini);
 
 MODULE_LICENSE("GPL");
index ea9c75b..4c82bf1 100644 (file)
@@ -167,7 +167,7 @@ static void __exit lzorle_mod_fini(void)
        crypto_unregister_scomp(&scomp);
 }
 
-module_init(lzorle_mod_init);
+subsys_initcall(lzorle_mod_init);
 module_exit(lzorle_mod_fini);
 
 MODULE_LICENSE("GPL");
index 218567d..4a6ac8f 100644 (file)
@@ -167,7 +167,7 @@ static void __exit lzo_mod_fini(void)
        crypto_unregister_scomp(&scomp);
 }
 
-module_init(lzo_mod_init);
+subsys_initcall(lzo_mod_init);
 module_exit(lzo_mod_fini);
 
 MODULE_LICENSE("GPL");
index 9965ec4..9a1a228 100644 (file)
@@ -232,7 +232,7 @@ static void __exit md4_mod_fini(void)
        crypto_unregister_shash(&alg);
 }
 
-module_init(md4_mod_init);
+subsys_initcall(md4_mod_init);
 module_exit(md4_mod_fini);
 
 MODULE_LICENSE("GPL");
index 94dd781..221c2c0 100644 (file)
@@ -244,7 +244,7 @@ static void __exit md5_mod_fini(void)
        crypto_unregister_shash(&alg);
 }
 
-module_init(md5_mod_init);
+subsys_initcall(md5_mod_init);
 module_exit(md5_mod_fini);
 
 MODULE_LICENSE("GPL");
index 46195e0..538ae79 100644 (file)
@@ -178,7 +178,7 @@ static void __exit michael_mic_exit(void)
 }
 
 
-module_init(michael_mic_init);
+subsys_initcall(michael_mic_init);
 module_exit(michael_mic_exit);
 
 MODULE_LICENSE("GPL v2");
index 0747732..f8734c6 100644 (file)
@@ -532,7 +532,7 @@ static void __exit crypto_morus1280_module_exit(void)
        crypto_unregister_aead(&crypto_morus1280_alg);
 }
 
-module_init(crypto_morus1280_module_init);
+subsys_initcall(crypto_morus1280_module_init);
 module_exit(crypto_morus1280_module_exit);
 
 MODULE_LICENSE("GPL");
index 1617a1e..ae5aa94 100644 (file)
@@ -523,7 +523,7 @@ static void __exit crypto_morus640_module_exit(void)
        crypto_unregister_aead(&crypto_morus640_alg);
 }
 
-module_init(crypto_morus640_module_init);
+subsys_initcall(crypto_morus640_module_init);
 module_exit(crypto_morus640_module_exit);
 
 MODULE_LICENSE("GPL");
index ec831a5..9ab4e07 100644 (file)
@@ -244,7 +244,7 @@ static void __exit nhpoly1305_mod_exit(void)
        crypto_unregister_shash(&nhpoly1305_alg);
 }
 
-module_init(nhpoly1305_mod_init);
+subsys_initcall(nhpoly1305_mod_init);
 module_exit(nhpoly1305_mod_exit);
 
 MODULE_DESCRIPTION("NHPoly1305 ε-almost-∆-universal hash function");
index 34b6e1f..133ff4c 100644 (file)
@@ -95,7 +95,7 @@ static void __exit crypto_ofb_module_exit(void)
        crypto_unregister_template(&crypto_ofb_tmpl);
 }
 
-module_init(crypto_ofb_module_init);
+subsys_initcall(crypto_ofb_module_init);
 module_exit(crypto_ofb_module_exit);
 
 MODULE_LICENSE("GPL");
index 2fa03fc..31b3ce9 100644 (file)
@@ -191,7 +191,7 @@ static void __exit crypto_pcbc_module_exit(void)
        crypto_unregister_template(&crypto_pcbc_tmpl);
 }
 
-module_init(crypto_pcbc_module_init);
+subsys_initcall(crypto_pcbc_module_init);
 module_exit(crypto_pcbc_module_exit);
 
 MODULE_LICENSE("GPL");
index d47cfc4..0e9ce32 100644 (file)
@@ -512,7 +512,7 @@ static void __exit pcrypt_exit(void)
        crypto_unregister_template(&pcrypt_tmpl);
 }
 
-module_init(pcrypt_init);
+subsys_initcall(pcrypt_init);
 module_exit(pcrypt_exit);
 
 MODULE_LICENSE("GPL");
index 2a06874..adc4029 100644 (file)
@@ -318,7 +318,7 @@ static void __exit poly1305_mod_exit(void)
        crypto_unregister_shash(&poly1305_alg);
 }
 
-module_init(poly1305_mod_init);
+subsys_initcall(poly1305_mod_init);
 module_exit(poly1305_mod_exit);
 
 MODULE_LICENSE("GPL");
index 5f44722..faf4252 100644 (file)
@@ -318,7 +318,7 @@ static void __exit rmd128_mod_fini(void)
        crypto_unregister_shash(&alg);
 }
 
-module_init(rmd128_mod_init);
+subsys_initcall(rmd128_mod_init);
 module_exit(rmd128_mod_fini);
 
 MODULE_LICENSE("GPL");
index 7376453..b333099 100644 (file)
@@ -362,7 +362,7 @@ static void __exit rmd160_mod_fini(void)
        crypto_unregister_shash(&alg);
 }
 
-module_init(rmd160_mod_init);
+subsys_initcall(rmd160_mod_init);
 module_exit(rmd160_mod_fini);
 
 MODULE_LICENSE("GPL");
index 0e9d306..2a64325 100644 (file)
@@ -337,7 +337,7 @@ static void __exit rmd256_mod_fini(void)
        crypto_unregister_shash(&alg);
 }
 
-module_init(rmd256_mod_init);
+subsys_initcall(rmd256_mod_init);
 module_exit(rmd256_mod_fini);
 
 MODULE_LICENSE("GPL");
index 3ae1df5..2f06257 100644 (file)
@@ -386,7 +386,7 @@ static void __exit rmd320_mod_fini(void)
        crypto_unregister_shash(&alg);
 }
 
-module_init(rmd320_mod_init);
+subsys_initcall(rmd320_mod_init);
 module_exit(rmd320_mod_fini);
 
 MODULE_LICENSE("GPL");
index 5d427c1..dcbb034 100644 (file)
@@ -282,7 +282,7 @@ static void rsa_exit(void)
        crypto_unregister_akcipher(&rsa);
 }
 
-module_init(rsa_init);
+subsys_initcall(rsa_init);
 module_exit(rsa_exit);
 MODULE_ALIAS_CRYPTO("rsa");
 MODULE_LICENSE("GPL");
index faed244..c81a444 100644 (file)
@@ -203,7 +203,7 @@ static void __exit salsa20_generic_mod_fini(void)
        crypto_unregister_skcipher(&alg);
 }
 
-module_init(salsa20_generic_mod_init);
+subsys_initcall(salsa20_generic_mod_init);
 module_exit(salsa20_generic_mod_fini);
 
 MODULE_LICENSE("GPL");
index c6ba843..a75ac50 100644 (file)
@@ -470,7 +470,7 @@ static void __exit seed_fini(void)
        crypto_unregister_alg(&seed_alg);
 }
 
-module_init(seed_init);
+subsys_initcall(seed_init);
 module_exit(seed_fini);
 
 MODULE_DESCRIPTION("SEED Cipher Algorithm");
index ed1b0e9..3f2fad6 100644 (file)
@@ -211,7 +211,7 @@ static void __exit seqiv_module_exit(void)
        crypto_unregister_template(&seqiv_tmpl);
 }
 
-module_init(seqiv_module_init);
+subsys_initcall(seqiv_module_init);
 module_exit(seqiv_module_exit);
 
 MODULE_LICENSE("GPL");
index 7c3382f..ec4ec89 100644 (file)
@@ -664,7 +664,7 @@ static void __exit serpent_mod_fini(void)
        crypto_unregister_algs(srp_algs, ARRAY_SIZE(srp_algs));
 }
 
-module_init(serpent_mod_init);
+subsys_initcall(serpent_mod_init);
 module_exit(serpent_mod_fini);
 
 MODULE_LICENSE("GPL");
index 2af64ef..1b806d4 100644 (file)
@@ -92,7 +92,7 @@ static void __exit sha1_generic_mod_fini(void)
        crypto_unregister_shash(&alg);
 }
 
-module_init(sha1_generic_mod_init);
+subsys_initcall(sha1_generic_mod_init);
 module_exit(sha1_generic_mod_fini);
 
 MODULE_LICENSE("GPL");
index 1e5ba66..5844e9a 100644 (file)
@@ -301,7 +301,7 @@ static void __exit sha256_generic_mod_fini(void)
        crypto_unregister_shashes(sha256_algs, ARRAY_SIZE(sha256_algs));
 }
 
-module_init(sha256_generic_mod_init);
+subsys_initcall(sha256_generic_mod_init);
 module_exit(sha256_generic_mod_fini);
 
 MODULE_LICENSE("GPL");
index 7ed9836..60fd2be 100644 (file)
@@ -294,7 +294,7 @@ static void __exit sha3_generic_mod_fini(void)
        crypto_unregister_shashes(algs, ARRAY_SIZE(algs));
 }
 
-module_init(sha3_generic_mod_init);
+subsys_initcall(sha3_generic_mod_init);
 module_exit(sha3_generic_mod_fini);
 
 MODULE_LICENSE("GPL");
index 4097cd5..0193ecb 100644 (file)
@@ -223,7 +223,7 @@ static void __exit sha512_generic_mod_fini(void)
        crypto_unregister_shashes(sha512_algs, ARRAY_SIZE(sha512_algs));
 }
 
-module_init(sha512_generic_mod_init);
+subsys_initcall(sha512_generic_mod_init);
 module_exit(sha512_generic_mod_fini);
 
 MODULE_LICENSE("GPL");
index c0cf87a..e227bca 100644 (file)
@@ -199,7 +199,7 @@ static void __exit sm3_generic_mod_fini(void)
        crypto_unregister_shash(&sm3_alg);
 }
 
-module_init(sm3_generic_mod_init);
+subsys_initcall(sm3_generic_mod_init);
 module_exit(sm3_generic_mod_fini);
 
 MODULE_LICENSE("GPL v2");
index c18eebf..71ffb34 100644 (file)
@@ -237,7 +237,7 @@ static void __exit sm4_fini(void)
        crypto_unregister_alg(&sm4_alg);
 }
 
-module_init(sm4_init);
+subsys_initcall(sm4_init);
 module_exit(sm4_fini);
 
 MODULE_DESCRIPTION("SM4 Cipher Algorithm");
index b82fc3d..63663c3 100644 (file)
@@ -1128,7 +1128,7 @@ static void __exit streebog_mod_fini(void)
        crypto_unregister_shashes(algs, ARRAY_SIZE(algs));
 }
 
-module_init(streebog_mod_init);
+subsys_initcall(streebog_mod_init);
 module_exit(streebog_mod_fini);
 
 MODULE_LICENSE("GPL");
index 1ea2d50..798253f 100644 (file)
@@ -3053,7 +3053,7 @@ err_free_tv:
  */
 static void __exit tcrypt_mod_fini(void) { }
 
-module_init(tcrypt_mod_init);
+subsys_initcall(tcrypt_mod_init);
 module_exit(tcrypt_mod_fini);
 
 module_param(alg, charp, 0);
index b70b441..786b589 100644 (file)
@@ -274,7 +274,7 @@ MODULE_ALIAS_CRYPTO("tea");
 MODULE_ALIAS_CRYPTO("xtea");
 MODULE_ALIAS_CRYPTO("xeta");
 
-module_init(tea_mod_init);
+subsys_initcall(tea_mod_init);
 module_exit(tea_mod_fini);
 
 MODULE_LICENSE("GPL");
index f8e1d9f..40020f8 100644 (file)
@@ -677,7 +677,7 @@ MODULE_ALIAS_CRYPTO("tgr192");
 MODULE_ALIAS_CRYPTO("tgr160");
 MODULE_ALIAS_CRYPTO("tgr128");
 
-module_init(tgr192_mod_init);
+subsys_initcall(tgr192_mod_init);
 module_exit(tgr192_mod_fini);
 
 MODULE_LICENSE("GPL");
index 07e6243..dbac6e2 100644 (file)
@@ -205,7 +205,7 @@ static void __exit twofish_mod_fini(void)
        crypto_unregister_alg(&alg);
 }
 
-module_init(twofish_mod_init);
+subsys_initcall(twofish_mod_init);
 module_exit(twofish_mod_fini);
 
 MODULE_LICENSE("GPL");
index 5f436df..f50a850 100644 (file)
@@ -690,7 +690,7 @@ static void __exit vmac_module_exit(void)
        crypto_unregister_template(&vmac64_tmpl);
 }
 
-module_init(vmac_module_init);
+subsys_initcall(vmac_module_init);
 module_exit(vmac_module_exit);
 
 MODULE_LICENSE("GPL");
index 149e577..1b8e502 100644 (file)
@@ -1168,7 +1168,7 @@ MODULE_ALIAS_CRYPTO("wp512");
 MODULE_ALIAS_CRYPTO("wp384");
 MODULE_ALIAS_CRYPTO("wp256");
 
-module_init(wp512_mod_init);
+subsys_initcall(wp512_mod_init);
 module_exit(wp512_mod_fini);
 
 MODULE_LICENSE("GPL");
index c055f57..94ca694 100644 (file)
@@ -282,7 +282,7 @@ static void __exit crypto_xcbc_module_exit(void)
        crypto_unregister_template(&crypto_xcbc_tmpl);
 }
 
-module_init(crypto_xcbc_module_init);
+subsys_initcall(crypto_xcbc_module_init);
 module_exit(crypto_xcbc_module_exit);
 
 MODULE_LICENSE("GPL");
index 847f54f..aed11e6 100644 (file)
@@ -359,7 +359,7 @@ static void __exit crypto_module_exit(void)
        crypto_unregister_template(&crypto_tmpl);
 }
 
-module_init(crypto_module_init);
+subsys_initcall(crypto_module_init);
 module_exit(crypto_module_exit);
 
 MODULE_LICENSE("GPL");
index 9a76b3e..2c04055 100644 (file)
@@ -257,7 +257,7 @@ static void __exit zstd_mod_fini(void)
        crypto_unregister_scomp(&scomp);
 }
 
-module_init(zstd_mod_init);
+subsys_initcall(zstd_mod_init);
 module_exit(zstd_mod_fini);
 
 MODULE_LICENSE("GPL");