linux/drivers/crypto/ccp
Dan Carpenter 505d9dcb0f crypto: ccp - fix resource leaks in ccp_run_aes_gcm_cmd()
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>
2021-09-24 15:58:41 +08:00
..
ccp-crypto-aes-cmac.c crypto: drivers - set the flag CRYPTO_ALG_ALLOCATES_MEMORY 2020-07-16 21:49:10 +10:00
ccp-crypto-aes-galois.c crypto: drivers - set the flag CRYPTO_ALG_ALLOCATES_MEMORY 2020-07-16 21:49:10 +10:00
ccp-crypto-aes-xts.c crypto: drivers - set the flag CRYPTO_ALG_ALLOCATES_MEMORY 2020-07-16 21:49:10 +10:00
ccp-crypto-aes.c crypto: drivers - set the flag CRYPTO_ALG_ALLOCATES_MEMORY 2020-07-16 21:49:10 +10:00
ccp-crypto-des3.c crypto: drivers - set the flag CRYPTO_ALG_ALLOCATES_MEMORY 2020-07-16 21:49:10 +10:00
ccp-crypto-main.c crypto: ccp - Use DEFINE_SPINLOCK() for spinlock 2021-04-09 17:41:06 +10:00
ccp-crypto-rsa.c mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
ccp-crypto-sha.c crypto: sha - split sha.h into sha1.h and sha2.h 2020-11-20 14:45:33 +11:00
ccp-crypto.h crypto: sha - split sha.h into sha1.h and sha2.h 2020-11-20 14:45:33 +11:00
ccp-debugfs.c crypto: ccp - Switch to SPDX license identifiers 2019-07-03 22:13:12 +08:00
ccp-dev-v3.c crypto: ccp - set max RSA modulus size for v3 platform devices as well 2019-12-11 16:36:55 +08:00
ccp-dev-v5.c crypto: ccp - Fix sparse warnings 2020-07-09 18:25:22 +10:00
ccp-dev.c crypto: ccp: ccp-dev: Fix a little doc-rot 2021-05-28 15:11:45 +08:00
ccp-dev.h crypto: ccp - Fix sparse warnings 2020-07-09 18:25:22 +10:00
ccp-dmaengine.c crypto: ccp - Use list_move_tail instead of list_del/list_add_tail in ccp-dmaengine.c 2021-06-17 15:07:30 +08:00
ccp-ops.c crypto: ccp - fix resource leaks in ccp_run_aes_gcm_cmd() 2021-09-24 15:58:41 +08:00
Kconfig crypto: ccp -- don't "select" CONFIG_DMADEVICES 2020-04-16 16:49:22 +10:00
Makefile crypto: ccp - add TEE support for Raven Ridge 2019-12-20 14:58:32 +08:00
psp-dev.c crypto: ccp - Cleanup sp_dev_master in psp_dev_destroy() 2020-03-12 23:00:12 +11:00
psp-dev.h crypto: ccp - add TEE support for Raven Ridge 2019-12-20 14:58:32 +08:00
sev-dev.c crypto: ccp - shutdown SEV firmware on kexec 2021-08-06 19:45:25 +08:00
sev-dev.h crypto: ccp: Use the stack and common buffer for INIT command 2021-04-21 12:20:07 -04:00
sp-dev.c crypto: ccp - Make ccp_dev_suspend and ccp_dev_resume void functions 2021-04-22 17:31:31 +10:00
sp-dev.h crypto: ccp - Make ccp_dev_suspend and ccp_dev_resume void functions 2021-04-22 17:31:31 +10:00
sp-pci.c crypto: ccp - Add support for new CCP/PSP device ID 2021-08-27 16:30:18 +08:00
sp-platform.c crypto: ccp - use generic power management 2020-07-31 18:25:26 +10:00
tee-dev.c crypto: ccp - fix command queuing to TEE ring buffer 2021-03-26 20:02:34 +11:00
tee-dev.h crypto: ccp - fix command queuing to TEE ring buffer 2021-03-26 20:02:34 +11:00