]> git.baikalelectronics.ru Git - kernel.git/commit
KEYS: trusted: correctly initialize digests and fix locking issue
authorRoberto Sassu <roberto.sassu@huawei.com>
Fri, 13 Sep 2019 18:51:36 +0000 (20:51 +0200)
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tue, 24 Sep 2019 23:43:53 +0000 (02:43 +0300)
commit3c7fea3f71501a8990cd0952a89cdb6cda5523df
tree321a5a52f90cd7fb6a9beabdd8ab596c4026cdb3
parent0516bbbe09e112c968e882047afab1e19c418ae3
KEYS: trusted: correctly initialize digests and fix locking issue

Commit ea27a5b26efe ("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: ea27a5b26efe ("tpm: pass an array of tpm_extend_digest structures to tpm_pcr_extend()")
Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Suggested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
drivers/char/tpm/tpm-interface.c
security/keys/trusted.c