[PATCH 5.10 4/4] crypto: api - Fix boot-up crash when crypto manager is disabled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>

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@xxxxxxxxxxxxxx>
Reported-by: Ido Schimmel <idosch@xxxxxxxxxx>
Reported-by: Guenter Roeck <linux@xxxxxxxxxxxx>
Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Tested-by: Ido Schimmel <idosch@xxxxxxxxxx>
Tested-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
Signed-off-by: Gaosheng Cui <cuigaosheng1@xxxxxxxxxx>
---
 crypto/algapi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/crypto/algapi.c b/crypto/algapi.c
index f6481cb79946..0d0c3e937e36 100644
--- a/crypto/algapi.c
+++ b/crypto/algapi.c
@@ -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);
 
-- 
2.25.1




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux