1
0
Fork 0
alistair23-linux/security/integrity/ima
Roberto Sassu 6f1a1d103b ima: Switch to ima_hash_algo for boot aggregate
boot_aggregate is the first entry of IMA measurement list. Its purpose is
to link pre-boot measurements to IMA measurements. As IMA was designed to
work with a TPM 1.2, the SHA1 PCR bank was always selected even if a
TPM 2.0 with support for stronger hash algorithms is available.

This patch first tries to find a PCR bank with the IMA default hash
algorithm. If it does not find it, it selects the SHA256 PCR bank for
TPM 2.0 and SHA1 for TPM 1.2. Ultimately, it selects SHA1 also for TPM 2.0
if the SHA256 PCR bank is not found.

If none of the PCR banks above can be found, boot_aggregate file digest is
filled with zeros, as for TPM bypass, making it impossible to perform a
remote attestation of the system.

Cc: stable@vger.kernel.org # 5.1.x
Fixes: 879b589210 ("tpm: retrieve digest size of unknown algorithms with PCR read")
Reported-by: Jerry Snitselaar <jsnitsel@redhat.com>
Suggested-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
2020-04-19 22:03:39 -04:00
..
Kconfig ima: add a new CONFIG for loading arch-specific policies 2020-03-12 07:43:57 -04:00
Makefile IMA: Update KBUILD_MODNAME for IMA files to ima 2020-02-28 14:32:58 -05:00
ima.h IMA: Defined delayed workqueue to free the queued keys 2020-01-23 07:37:31 -05:00
ima_api.c IMA: Add support to limit measuring keys 2019-12-12 08:53:50 -05:00
ima_appraise.c IMA: Add support to limit measuring keys 2019-12-12 08:53:50 -05:00
ima_asymmetric_keys.c integrity: Remove duplicate pr_fmt definitions 2020-02-28 14:32:58 -05:00
ima_crypto.c ima: Switch to ima_hash_algo for boot aggregate 2020-04-19 22:03:39 -04:00
ima_fs.c integrity: Remove duplicate pr_fmt definitions 2020-02-28 14:32:58 -05:00
ima_init.c ima: Switch to ima_hash_algo for boot aggregate 2020-04-19 22:03:39 -04:00
ima_kexec.c integrity: Remove duplicate pr_fmt definitions 2020-02-28 14:32:58 -05:00
ima_main.c integrity: Remove duplicate pr_fmt definitions 2020-02-28 14:32:58 -05:00
ima_modsig.c ima: Fix use after free in ima_read_modsig() 2019-08-28 15:01:24 -04:00
ima_mok.c Revert "Merge tag 'keys-acl-20190703' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs" 2019-07-10 18:43:43 -07:00
ima_policy.c integrity: Remove duplicate pr_fmt definitions 2020-02-28 14:32:58 -05:00
ima_queue.c integrity: Remove duplicate pr_fmt definitions 2020-02-28 14:32:58 -05:00
ima_queue_keys.c integrity: Remove duplicate pr_fmt definitions 2020-02-28 14:32:58 -05:00
ima_template.c integrity: Remove duplicate pr_fmt definitions 2020-02-28 14:32:58 -05:00
ima_template_lib.c integrity: Remove duplicate pr_fmt definitions 2020-02-28 14:32:58 -05:00
ima_template_lib.h ima: Define ima-modsig template 2019-08-05 18:40:25 -04:00