Skip to contentSkip to conversation

crypto: qat - initialize cra_flags before register into kpp

PATCH In review Giovanni Cabiddu 2 participants 2 messages Dec 22, 2016 – Dec 28, 2016 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: qat - initialize cra_flags before register into kpp

Initialize dh.base.cra_flags before registering the dh algorithm. Without this fix, the registration of the dh algorithm might fail if the qat driver is restarted.

---
 drivers/crypto/qat/qat_common/qat_asym_algs.c | 1 +
 1 file changed, 1 insertion(+)
drivers/crypto/qat/qat_common/qat_asym_algs.c +1 -0
index 0d35dca..d3518e6 100644
@@ -1343,6 +1343,7 @@ int qat_asym_algs_register(void)
 		ret = crypto_register_akcipher(&rsa);
 		if (ret)
 			goto unlock;
+		dh.base.cra_flags = 0;
 		ret = crypto_register_kpp(&dh);
 	}
 unlock:
Signature · 1 line
2.9.3
maintainer
#1 lore raw
Quoted 6 lines · Giovanni Cabiddu

Initialize dh.base.cra_flags before registering the dh algorithm. Without this fix, the registration of the dh algorithm might fail if the qat driver is restarted.

Please patch the crypto API instead. I think unsetting the bit CRYPTO_ALG_DEAD at the top of crypto_register_alg should do the trick.

Thanks,

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt