diff options
author | Corentin Labbe <clabbe@baylibre.com> | 2017-11-24 08:22:07 +0000 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2017-11-29 17:33:34 +1100 |
commit | 45223b78118cbab12744a7e193b6c7c208c15c27 (patch) | |
tree | aba74f17fe65bd259a12bba35b36f1b6f425f77d /arch/arm64/crypto/aes-glue.c | |
parent | 9f480faec58cd6197a007ea1dcac6b7c3daf1139 (diff) | |
download | linux-45223b78118cbab12744a7e193b6c7c208c15c27.tar.gz linux-45223b78118cbab12744a7e193b6c7c208c15c27.tar.bz2 linux-45223b78118cbab12744a7e193b6c7c208c15c27.zip |
crypto: arm64/aes - do not call crypto_unregister_skcipher twice on error
When a cipher fails to register in aes_init(), the error path goes thought
aes_exit() then crypto_unregister_skciphers().
Since aes_exit calls also crypto_unregister_skcipher, this triggers a
refcount_t: underflow; use-after-free.
Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'arch/arm64/crypto/aes-glue.c')
-rw-r--r-- | arch/arm64/crypto/aes-glue.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arm64/crypto/aes-glue.c b/arch/arm64/crypto/aes-glue.c index 998ba519a026..2fa850e86aa8 100644 --- a/arch/arm64/crypto/aes-glue.c +++ b/arch/arm64/crypto/aes-glue.c @@ -665,6 +665,7 @@ static int __init aes_init(void) unregister_simds: aes_exit(); + return err; unregister_ciphers: crypto_unregister_skciphers(aes_algs, ARRAY_SIZE(aes_algs)); return err; |