linux/drivers/crypto/qat
Lv Yunlong 1faf7e6199 crypto: qat - Fix a double free in adf_create_ring
[ Upstream commit f7cae626ca ]

In adf_create_ring, if the callee adf_init_ring() failed, the callee will
free the ring->base_addr by dma_free_coherent() and return -EFAULT. Then
adf_create_ring will goto err and the ring->base_addr will be freed again
in adf_cleanup_ring().

My patch sets ring->base_addr to NULL after the first freed to avoid the
double free.

Fixes: a672a9dc87 ("crypto: qat - Intel(R) QAT transport code")
Signed-off-by: Lv Yunlong <lyl2019@mail.ustc.edu.cn>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2021-05-14 09:50:17 +02:00
..
qat_c3xxx crypto: qat - drop input parameter from adf_enable_aer() 2020-10-08 16:38:06 +11:00
qat_c3xxxvf crypto: qat - ADF_STATUS_PF_RUNNING should be set after adf_dev_init 2021-05-14 09:50:12 +02:00
qat_c62x crypto: qat - drop input parameter from adf_enable_aer() 2020-10-08 16:38:06 +11:00
qat_c62xvf crypto: qat - ADF_STATUS_PF_RUNNING should be set after adf_dev_init 2021-05-14 09:50:12 +02:00
qat_common crypto: qat - Fix a double free in adf_create_ring 2021-05-14 09:50:17 +02:00
qat_dh895xcc crypto: qat - drop input parameter from adf_enable_aer() 2020-10-08 16:38:06 +11:00
qat_dh895xccvf crypto: qat - ADF_STATUS_PF_RUNNING should be set after adf_dev_init 2021-05-14 09:50:12 +02:00
Kconfig crypto: skcipher - rename the crypto_blkcipher module and kconfig option 2019-11-01 13:42:47 +08:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00