]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
keys/trusted_keys: fix handle passed to tpm_buf_append_name during unseal
authorSrish Srinivasan <ssrish@linux.ibm.com>
Fri, 23 Jan 2026 16:55:03 +0000 (22:25 +0530)
committerJarkko Sakkinen <jarkko@kernel.org>
Sun, 25 Jan 2026 17:03:45 +0000 (19:03 +0200)
commit6342969dafbc63597cfc221aa13c3b123c2800c5
tree6c9346de476c9d0488436894efb9847e8771a250
parentd91a46d6805af41e7f2286e0fc22d498f45a682b
keys/trusted_keys: fix handle passed to tpm_buf_append_name during unseal

TPM2_Unseal[1] expects the handle of a loaded data object, and not the
handle of the parent key. But the tpm2_unseal_cmd provides the parent
keyhandle instead of blob_handle for the session HMAC calculation. This
causes unseal to fail.

Fix this by passing blob_handle to tpm_buf_append_name().

References:

[1] trustedcomputinggroup.org/wp-content/uploads/
    Trusted-Platform-Module-2.0-Library-Part-3-Version-184_pub.pdf

Fixes: 6e9722e9a7bf ("tpm2-sessions: Fix out of range indexing in name_size")
Signed-off-by: Srish Srinivasan <ssrish@linux.ibm.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
security/keys/trusted-keys/trusted_tpm2.c