diff options
| author | Gunnar Kudrjavets <gunnarku@amazon.com> | 2026-05-10 20:11:27 +0300 |
|---|---|---|
| committer | Jarkko Sakkinen <jarkko@kernel.org> | 2026-06-21 04:25:28 +0300 |
| commit | 595ca21f797e43da24cb80529fb8b29381ed8716 (patch) | |
| tree | e988ff88602c502a3dad8f45ba5c65750ca62c1e /scripts/Makefile.thinlto | |
| parent | de59d78e64039baa5fed455ddb905ba8263e7ede (diff) | |
| download | linux-595ca21f797e43da24cb80529fb8b29381ed8716.tar.xz | |
tpm: Initialize name_size_alg for non-NULL name in tpm_buf_append_name()
tpm_buf_append_name() supports callers passing a pre-computed name
for handles. When name is non-NULL, the code skips the
tpm2_read_public() path but leaves name_size_alg uninitialized
before it is used as the memcpy size argument.
No current in-tree caller passes a non-NULL name, but future use
cases such as name caching would exercise this path. Initialize
name_size_alg by calling name_size() on the caller-provided name,
sharing the error check and assignment with the existing
tpm2_read_public() path. This prevents unmasking a latent bug when
the non-NULL name path is eventually used.
Assisted-by: Kiro:claude-opus-4.6
Reviewed-by: Justinien Bouron <jbouron@amazon.com>
Reviewed-by: Muhammad Hammad Ijaz <mhijaz@amazon.com>
Signed-off-by: Gunnar Kudrjavets <gunnarku@amazon.com>
Link: https://lore.kernel.org/r/20260510171152.4607-1-gunnarku@amazon.com
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
