Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Srish Srinivasan and committed by
Jarkko Sakkinen
6342969d d91a46d6

+2 -2
+2 -2
security/keys/trusted-keys/trusted_tpm2.c
··· 465 465 } 466 466 467 467 /** 468 - * tpm2_unseal_cmd() - execute a TPM2_Unload command 468 + * tpm2_unseal_cmd() - execute a TPM2_Unseal command 469 469 * 470 470 * @chip: TPM chip to use 471 471 * @payload: the key data in clear and encrypted form ··· 498 498 return rc; 499 499 } 500 500 501 - rc = tpm_buf_append_name(chip, &buf, options->keyhandle, NULL); 501 + rc = tpm_buf_append_name(chip, &buf, blob_handle, NULL); 502 502 if (rc) 503 503 goto out; 504 504