Re: [PATCH v2] crypto: octeontx2: fix NULL pointer dereference

From: Herbert Xu
Date: Fri Jan 28 2022 - 00:44:20 EST


Shijith Thotton <sthotton@xxxxxxxxxxx> wrote:
>
> diff --git a/drivers/crypto/marvell/octeontx2/otx2_cptvf_algs.c b/drivers/crypto/marvell/octeontx2/otx2_cptvf_algs.c
> index 2748a3327e39..620fa9b23e78 100644
> --- a/drivers/crypto/marvell/octeontx2/otx2_cptvf_algs.c
> +++ b/drivers/crypto/marvell/octeontx2/otx2_cptvf_algs.c
> @@ -1650,7 +1650,7 @@ static inline int cpt_register_algs(void)
>
> err = crypto_register_aeads(otx2_cpt_aeads,
> ARRAY_SIZE(otx2_cpt_aeads));
> - if (err) {
> + if (err && !IS_ENABLED(CONFIG_DM_CRYPT)) {
> crypto_unregister_skciphers(otx2_cpt_skciphers,
> ARRAY_SIZE(otx2_cpt_skciphers));
> return err;

A better fix would be to make the driver actually work with
dm-crypt. What exactly is the issue?

Even if we have to keep the kludge, please move this into Kconfig
as a dependency and simply disable the whole driver.

Thanks,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt