crypto: api - Fix boot-up crash when crypto manager is disabled
authorHerbert Xu <herbert@gondor.apana.org.au>
Fri, 5 Nov 2021 07:26:08 +0000 (15:26 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 9 Nov 2021 05:45:48 +0000 (13:45 +0800)
When the crypto manager is disabled, we need to explicitly set
the crypto algorithms' tested status so that they can be used.

Fixes: cad439fc040e ("crypto: api - Do not create test larvals if...")
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reported-by: Ido Schimmel <idosch@idosch.org>
Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Tested-by: Ido Schimmel <idosch@nvidia.com>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/algapi.c

index d379fd9..a366cb3 100644 (file)
@@ -284,6 +284,8 @@ static struct crypto_larval *__crypto_register_alg(struct crypto_alg *alg)
 
        if (larval)
                list_add(&larval->alg.cra_list, &crypto_alg_list);
+       else
+               alg->cra_flags |= CRYPTO_ALG_TESTED;
 
        crypto_stats_init(alg);