]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
crypto: aesni - fix failing setkey for rfc4106-gcm-aesni
authorTadeusz Struk <tadeusz.struk@intel.com>
Sat, 27 Jun 2015 06:56:38 +0000 (15:56 +0900)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 29 Jun 2015 08:06:30 +0000 (16:06 +0800)
rfc4106(gcm(aes)) uses ctr(aes) to generate hash key. ctr(aes) needs
chainiv, but the chainiv gets initialized after aesni_intel when both
are statically linked so the setkey fails.
This patch forces aesni_intel to be initialized after chainiv.

Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
Tested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/x86/crypto/aesni-intel_glue.c

index 2bfc8a7c88c11e1d4f20d4d3c58e62063c76328f..dccad38b59a8d741fe5f442b558b63de2b4d931d 100644 (file)
@@ -1537,7 +1537,7 @@ static void __exit aesni_exit(void)
        crypto_fpu_exit();
 }
 
-module_init(aesni_init);
+late_initcall(aesni_init);
 module_exit(aesni_exit);
 
 MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm, Intel AES-NI instructions optimized");