linux_dsm_epyc7002/drivers/crypto
John Garry 0b0cf6af3f crypto: hisilicon - Fix reference after free of memories on error path
coccicheck currently warns of the following issues in the driver:
drivers/crypto/hisilicon/sec/sec_algs.c:864:51-66: ERROR: reference preceded by free on line 812
drivers/crypto/hisilicon/sec/sec_algs.c:864:40-49: ERROR: reference preceded by free on line 813
drivers/crypto/hisilicon/sec/sec_algs.c:861:8-24: ERROR: reference preceded by free on line 814
drivers/crypto/hisilicon/sec/sec_algs.c:860:41-51: ERROR: reference preceded by free on line 815
drivers/crypto/hisilicon/sec/sec_algs.c:867:7-18: ERROR: reference preceded by free on line 816

It would appear than on certain error paths that we may attempt reference-
after-free some memories.

This patch fixes those issues. The solution doesn't look perfect, but
having same memories free'd possibly from separate functions makes it
tricky.

Fixes: 915e4e8413 ("crypto: hisilicon - SEC security accelerator driver")
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2018-11-09 17:35:43 +08:00
..
amcc
axis crypto: axis - fix platform_no_drv_owner.cocci warnings 2018-10-12 14:20:44 +08:00
bcm
caam crypto: caam - add SPDX license identifier to all files 2018-10-17 14:16:18 +08:00
cavium crypto: cavium/nitrox - use pci_alloc_irq_vectors() while enabling MSI-X. 2018-10-05 10:22:48 +08:00
ccp crypto: ccp - Make function sev_get_firmware() static 2018-10-05 10:16:56 +08:00
ccree crypto: ccree - avoid implicit enum conversion 2018-10-17 14:16:18 +08:00
chelsio Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2018-10-25 16:43:35 -07:00
hisilicon crypto: hisilicon - Fix reference after free of memories on error path 2018-11-09 17:35:43 +08:00
inside-secure treewide: Replace more open-coded allocation size multiplications 2018-10-05 18:06:30 -07:00
marvell
mediatek
nx
qat Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2018-10-25 16:43:35 -07:00
qce crypto: qce - Remove VLA usage of skcipher 2018-09-28 12:46:08 +08:00
rockchip
stm32
sunxi-ss
ux500
virtio
vmx crypto: vmx - Remove VLA usage of skcipher 2018-09-28 12:46:08 +08:00
atmel-aes-regs.h
atmel-aes.c crypto: atmel - switch to SPDX license identifiers 2018-09-04 11:37:04 +08:00
atmel-authenc.h crypto: atmel - switch to SPDX license identifiers 2018-09-04 11:37:04 +08:00
atmel-ecc.c crypto: atmel - switch to SPDX license identifiers 2018-09-04 11:37:04 +08:00
atmel-ecc.h crypto: atmel - switch to SPDX license identifiers 2018-09-04 11:37:04 +08:00
atmel-sha-regs.h
atmel-sha.c crypto: atmel - switch to SPDX license identifiers 2018-09-04 11:37:04 +08:00
atmel-tdes-regs.h
atmel-tdes.c crypto: atmel - switch to SPDX license identifiers 2018-09-04 11:37:04 +08:00
exynos-rng.c
geode-aes.c
geode-aes.h
hifn_795x.c
img-hash.c
ixp4xx_crypto.c
Kconfig s390/zcrypt: multiple zcrypt device nodes support 2018-10-08 09:09:58 +02:00
Makefile crypto: caam/qi2 - add DPAA2-CAAM driver 2018-09-21 13:24:51 +08:00
mxc-scc.c
mxs-dcp.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2018-10-17 14:14:06 +08:00
n2_asm.S
n2_core.c
n2_core.h
omap-aes-gcm.c
omap-aes.c crypto: omap-aes - Remove VLA usage of skcipher 2018-09-28 12:46:09 +08:00
omap-aes.h crypto: omap-aes - Remove VLA usage of skcipher 2018-09-28 12:46:09 +08:00
omap-crypto.c
omap-crypto.h
omap-des.c
omap-sham.c
padlock-aes.c
padlock-sha.c
picoxcell_crypto_regs.h
picoxcell_crypto.c crypto: picoxcell - Remove VLA usage of skcipher 2018-09-28 12:46:09 +08:00
qcom-rng.c
s5p-sss.c crypto: s5p-sss: Add aes-ctr support 2018-09-28 12:46:06 +08:00
sahara.c crypto: sahara - Remove VLA usage of skcipher 2018-09-28 12:46:08 +08:00
talitos.c
talitos.h