Skip to content
  • Roberto Sassu's avatar
    KEYS: trusted: correctly initialize digests and fix locking issue · 9f75c822
    Roberto Sassu authored
    Commit 0b6cf6b9 ("tpm: pass an array of tpm_extend_digest structures to
    tpm_pcr_extend()") modifies tpm_pcr_extend() to accept a digest for each
    PCR bank. After modification, tpm_pcr_extend() expects that digests are
    passed in the same order as the algorithms set in chip->allocated_banks.
    
    This patch fixes two issues introduced in the last iterations of the patch
    set: missing initialization of the TPM algorithm ID in the tpm_digest
    structures passed to tpm_pcr_extend() by the trusted key module, and
    unreleased locks in the TPM driver due to returning from tpm_pcr_extend()
    without calling tpm_put_ops().
    
    Cc: stable@vger.kernel.org
    Fixes: 0b6cf6b9
    
     ("tpm: pass an array of tpm_extend_digest structures to tpm_pcr_extend()")
    Signed-off-by: default avatarRoberto Sassu <roberto.sassu@huawei.com>
    Suggested-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
    Reviewed-by: default avatarJerry Snitselaar <jsnitsel@redhat.com>
    Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen...
    9f75c822