Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: octeontx2 - remove CONFIG_DM_CRYPT check

No issues were found while using the driver with dm-crypt enabled. So
CONFIG_DM_CRYPT check in the driver can be removed.

This also fixes the NULL pointer dereference in driver release if
CONFIG_DM_CRYPT is enabled.

...
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008
...
Call trace:
crypto_unregister_alg+0x68/0xfc
crypto_unregister_skciphers+0x44/0x60
otx2_cpt_crypto_exit+0x100/0x1a0
otx2_cptvf_remove+0xf8/0x200
pci_device_remove+0x3c/0xd4
__device_release_driver+0x188/0x234
device_release_driver+0x2c/0x4c
...

Fixes: 6f03f0e8b6c8 ("crypto: octeontx2 - register with linux crypto framework")
Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Shijith Thotton and committed by
Herbert Xu
2d841af2 388ac25e

+6 -9
+6 -9
drivers/crypto/marvell/octeontx2/otx2_cptvf_algs.c
··· 1634 1634 { 1635 1635 int i, err = 0; 1636 1636 1637 - if (!IS_ENABLED(CONFIG_DM_CRYPT)) { 1638 - for (i = 0; i < ARRAY_SIZE(otx2_cpt_skciphers); i++) 1639 - otx2_cpt_skciphers[i].base.cra_flags &= 1640 - ~CRYPTO_ALG_DEAD; 1637 + for (i = 0; i < ARRAY_SIZE(otx2_cpt_skciphers); i++) 1638 + otx2_cpt_skciphers[i].base.cra_flags &= ~CRYPTO_ALG_DEAD; 1641 1639 1642 - err = crypto_register_skciphers(otx2_cpt_skciphers, 1643 - ARRAY_SIZE(otx2_cpt_skciphers)); 1644 - if (err) 1645 - return err; 1646 - } 1640 + err = crypto_register_skciphers(otx2_cpt_skciphers, 1641 + ARRAY_SIZE(otx2_cpt_skciphers)); 1642 + if (err) 1643 + return err; 1647 1644 1648 1645 for (i = 0; i < ARRAY_SIZE(otx2_cpt_aeads); i++) 1649 1646 otx2_cpt_aeads[i].base.cra_flags &= ~CRYPTO_ALG_DEAD;