linux/security/keys/trusted-keys
Jarkko Sakkinen 9b015f2918 KEYS: trusted: Fix a memory leak in tpm2_load_cmd
commit 62cd5d480b upstream.

'tpm2_load_cmd' allocates a tempoary blob indirectly via 'tpm2_key_decode'
but it is not freed in the failure paths. Address this by wrapping the blob
into with a cleanup helper.

Cc: stable@vger.kernel.org # v5.13+
Fixes: f221974525 ("security: keys: trusted: use ASN.1 TPM2 key format for the blobs")
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-01-08 10:14:13 +01:00
..
Kconfig KEYS: trusted: Introduce NXP DCP-backed trusted keys 2024-05-09 18:29:03 +03:00
Makefile KEYS: trusted: Introduce NXP DCP-backed trusted keys 2024-05-09 18:29:03 +03:00
tpm2key.asn1 security: keys: trusted: use ASN.1 TPM2 key format for the blobs 2021-04-14 16:30:30 +03:00
trusted_caam.c KEYS: trusted: Introduce support for NXP CAAM-based trusted keys 2022-05-23 18:47:50 +03:00
trusted_core.c KEYS: trusted: add missing MODULE_DESCRIPTION() 2024-07-01 14:16:54 +00:00
trusted_dcp.c KEYS: trusted: dcp: fix improper sg use with CONFIG_VMAP_STACK=y 2025-02-17 10:05:09 +01:00
trusted_tee.c KEYS: trusted: tee: Refactor register SHM usage 2023-10-24 03:06:35 +03:00
trusted_tpm1.c KEYS: trusted_tpm1: Compare HMAC values in constant time 2025-10-19 16:33:51 +02:00
trusted_tpm2.c KEYS: trusted: Fix a memory leak in tpm2_load_cmd 2026-01-08 10:14:13 +01:00