]> git.ipfire.org Git - thirdparty/grub.git/commit
commands/tpm: Don't propagate measurement failures to the verifiers layer
authorRobbie Harwood <rharwood@redhat.com>
Fri, 4 Nov 2022 16:13:36 +0000 (12:13 -0400)
committerDaniel Kiper <daniel.kiper@oracle.com>
Mon, 14 Nov 2022 16:30:53 +0000 (17:30 +0100)
commita4356538d03c5a5350790b6453b523fb9214c2e9
treec232d926c9cb6aed3435e201c12c74eba7e680b8
parentb20192f22c0654039488f5d3ec07910fe438227b
commands/tpm: Don't propagate measurement failures to the verifiers layer

Currently if an EFI firmware fails to do a TPM measurement for a file,
the error will be propagated to the verifiers framework which will
prevent it to be opened. This mean that buggy firmwares will lead to
the system not booting because files won't be allowed to be loaded. But
a failure to do a TPM measurement isn't expected to be a fatal error
that causes the system to be unbootable.

To avoid this, don't return errors from .write and .verify_string
callbacks and just print a debug message in the case of a TPM
measurement failure. Add an environment variable, tpm_fail_fatal, to
restore the previous behavior.

Also-authored-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
docs/grub.texi
grub-core/commands/tpm.c