android_kernel_xiaomi_sm8350/drivers/crypto
Dan Carpenter 24f3d26091 crypto: ccp - fix resource leaks in ccp_run_aes_gcm_cmd()
commit 505d9dcb0f7ddf9d075e729523a33d38642ae680 upstream.

There are three bugs in this code:

1) If we ccp_init_data() fails for &src then we need to free aad.
   Use goto e_aad instead of goto e_ctx.
2) The label to free the &final_wa was named incorrectly as "e_tag" but
   it should have been "e_final_wa".  One error path leaked &final_wa.
3) The &tag was leaked on one error path.  In that case, I added a free
   before the goto because the resource was local to that block.

Fixes: 36cf515b9b ("crypto: ccp - Enable support for AES GCM on v5 CCPs")
Reported-by: "minihanshen(沈明航)" <minihanshen@tencent.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: John Allen <john.allen@amd.com>
Tested-by: John Allen <john.allen@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-06 15:42:39 +02:00
..
amcc
axis
bcm
caam
cavium crypto: nitrox - fix unchecked variable in nitrox_register_interrupts 2021-07-14 16:53:22 +02:00
ccp crypto: ccp - fix resource leaks in ccp_run_aes_gcm_cmd() 2021-10-06 15:42:39 +02:00
ccree
chelsio
hisilicon
inside-secure
marvell
mediatek
nx crypto: nx - Fix RCU warning in nx842_OF_upd_status 2021-07-14 16:53:24 +02:00
qat crypto: qat - use proper type for vf_mask 2021-09-15 09:47:29 +02:00
qce
rockchip
stm32
sunxi-ss
ux500 crypto: ux500 - Fix error return code in hash_hw_final() 2021-07-14 16:53:20 +02:00
virtio
vmx
atmel-aes-regs.h
atmel-aes.c
atmel-authenc.h
atmel-ecc.c
atmel-i2c.c
atmel-i2c.h
atmel-sha204a.c
atmel-sha-regs.h
atmel-sha.c
atmel-tdes-regs.h
atmel-tdes.c
exynos-rng.c
geode-aes.c
geode-aes.h
hifn_795x.c
img-hash.c
ixp4xx_crypto.c crypto: ixp4xx - dma_unmap the correct address 2021-07-14 16:53:20 +02:00
Kconfig
Makefile
mxs-dcp.c crypto: mxs-dcp - Use sg_mapping_iter to copy data 2021-09-22 12:26:26 +02:00
n2_asm.S
n2_core.c
n2_core.h
omap-aes-gcm.c
omap-aes.c
omap-aes.h
omap-crypto.c
omap-crypto.h
omap-des.c
omap-sham.c crypto: omap-sham - clear dma flags only after omap_sham_update_dma_stop() 2021-09-15 09:47:26 +02:00
padlock-aes.c
padlock-sha.c
picoxcell_crypto_regs.h
picoxcell_crypto.c
qcom-rng.c
s5p-sss.c
sahara.c
talitos.c
talitos.h