| 3d9e043d | 11-Jul-2026 |
Jarkko Sakkinen <jarkko.sakkinen@opinsys.com> |
tpm-buf: Memory-safe allocations
Decouple kzalloc from buffer creation, so that a managed allocation can be used:
struct tpm_buf *buf __free(kfree) buf = kzalloc(TPM_BUFSIZE, GFP_KERNEL); i
tpm-buf: Memory-safe allocations
Decouple kzalloc from buffer creation, so that a managed allocation can be used:
struct tpm_buf *buf __free(kfree) buf = kzalloc(TPM_BUFSIZE, GFP_KERNEL); if (!buf) return -ENOMEM;
tpm_buf_init(buf, TPM_BUFSIZE);
Alternatively, other allocations are also possible (static data, stack, etc) for example:
u8 buf_data[512]; struct tpm_buf *buf = (struct tpm_buf *)buf_data; tpm_buf_init(buf, sizeof(buf_data));
This is achieved by embedding buffer's header inside the allocated blob, instead of having an outer wrapper.
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@opinsys.com> Tested-by: Srish Srinivasan <ssrish@linux.ibm.com> Message-ID: <20260522013555.1063716-1-jarkko@kernel.org> Signed-off-by: Ross Philipson <ross.philipson@oracle.com>
show more ...
|
| cc99abbe | 16-May-2026 |
Len Bao <len.bao@gmx.us> |
keys/trusted_keys: mark 'migratable' as __ro_after_init
The 'migratable' variable is initialized only during the init phase in the 'init_trusted' function and never changed. So, mark it as __ro_afte
keys/trusted_keys: mark 'migratable' as __ro_after_init
The 'migratable' variable is initialized only during the init phase in the 'init_trusted' function and never changed. So, mark it as __ro_after_init.
Signed-off-by: Len Bao <len.bao@gmx.us> Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org> Link: https://lore.kernel.org/r/20260516152249.41851-1-len.bao@gmx.us Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
show more ...
|
| c6ef3e90 | 15-Dec-2025 |
Uwe Kleine-König <u.kleine-koenig@baylibre.com> |
KEYS: trusted: Make use of tee bus methods
The tee bus got dedicated callbacks for probe and remove. Make use of these. This fixes a runtime warning about the driver needing to be converted to the b
KEYS: trusted: Make use of tee bus methods
The tee bus got dedicated callbacks for probe and remove. Make use of these. This fixes a runtime warning about the driver needing to be converted to the bus methods.
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| b7960b90 | 30-Sep-2025 |
Jarkko Sakkinen <jarkko.sakkinen@opinsys.com> |
tpm2-sessions: Open code tpm_buf_append_hmac_session()
Open code 'tpm_buf_append_hmac_session_opt' to the call site, as it only masks a call sequence and does otherwise nothing particularly useful.
tpm2-sessions: Open code tpm_buf_append_hmac_session()
Open code 'tpm_buf_append_hmac_session_opt' to the call site, as it only masks a call sequence and does otherwise nothing particularly useful.
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@opinsys.com> Reviewed-by: Jonathan McDowell <noodles@meta.com>
show more ...
|
| 62cd5d48 | 18-Oct-2025 |
Jarkko Sakkinen <jarkko@kernel.org> |
KEYS: trusted: Fix a memory leak in tpm2_load_cmd
'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 bl
KEYS: trusted: Fix a memory leak in tpm2_load_cmd
'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: f2219745250f ("security: keys: trusted: use ASN.1 TPM2 key format for the blobs") Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
show more ...
|