dcavalca / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone
Zbigniew Jędrzejewski-Szmek 27bd1b
From ea0ff5cd4efb1d67820572fb0d7d1d8da0fc1dc1 Mon Sep 17 00:00:00 2001
Zbigniew Jędrzejewski-Szmek 27bd1b
From: Harald Hoyer <harald@hoyer.xyz>
Zbigniew Jędrzejewski-Szmek 27bd1b
Date: Fri, 28 Jul 2017 09:46:05 +0200
Zbigniew Jędrzejewski-Szmek 27bd1b
Subject: [PATCH] boot/efi: don't hard fail on error for tpm measure (#6473)
Zbigniew Jędrzejewski-Szmek 27bd1b
Zbigniew Jędrzejewski-Szmek 27bd1b
Display the error for a small amount of time, but don't fail hard.
Zbigniew Jędrzejewski-Szmek 27bd1b
Zbigniew Jędrzejewski-Szmek 27bd1b
In case of a faulty BIOS, a TPM error should not prevent the boot.
Zbigniew Jędrzejewski-Szmek 27bd1b
If something cares about the PCM measurement, it will be noticed
Zbigniew Jędrzejewski-Szmek 27bd1b
anyway later on.
Zbigniew Jędrzejewski-Szmek 27bd1b
Zbigniew Jędrzejewski-Szmek 27bd1b
Especially important now, that TPM measurement is the default now on
Zbigniew Jędrzejewski-Szmek 27bd1b
some distribution builds.
Zbigniew Jędrzejewski-Szmek 27bd1b
Zbigniew Jędrzejewski-Szmek 27bd1b
https://bugzilla.redhat.com/show_bug.cgi?id=1411156
Zbigniew Jędrzejewski-Szmek 27bd1b
(cherry picked from commit 522aa9f5f8755d7389131da41bd60b6276917ff2)
Zbigniew Jędrzejewski-Szmek 27bd1b
---
Zbigniew Jędrzejewski-Szmek 27bd1b
 src/boot/efi/boot.c | 3 +--
Zbigniew Jędrzejewski-Szmek 27bd1b
 src/boot/efi/stub.c | 3 +--
Zbigniew Jędrzejewski-Szmek 27bd1b
 2 files changed, 2 insertions(+), 4 deletions(-)
Zbigniew Jędrzejewski-Szmek 27bd1b
Zbigniew Jędrzejewski-Szmek 27bd1b
diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c
Zbigniew Jędrzejewski-Szmek 27bd1b
index 1e990b3825..316e95a72b 100644
Zbigniew Jędrzejewski-Szmek 27bd1b
--- a/src/boot/efi/boot.c
Zbigniew Jędrzejewski-Szmek 27bd1b
+++ b/src/boot/efi/boot.c
Zbigniew Jędrzejewski-Szmek 27bd1b
@@ -1657,8 +1657,7 @@ static EFI_STATUS image_start(EFI_HANDLE parent_image, const Config *config, con
Zbigniew Jędrzejewski-Szmek 27bd1b
                                     loaded_image->LoadOptionsSize, loaded_image->LoadOptions);
Zbigniew Jędrzejewski-Szmek 27bd1b
                 if (EFI_ERROR(err)) {
Zbigniew Jędrzejewski-Szmek 27bd1b
                         Print(L"Unable to add image options measurement: %r", err);
Zbigniew Jędrzejewski-Szmek 27bd1b
-                        uefi_call_wrapper(BS->Stall, 1, 3 * 1000 * 1000);
Zbigniew Jędrzejewski-Szmek 27bd1b
-                        return err;
Zbigniew Jędrzejewski-Szmek 27bd1b
+                        uefi_call_wrapper(BS->Stall, 1, 200 * 1000);
Zbigniew Jędrzejewski-Szmek 27bd1b
                 }
Zbigniew Jędrzejewski-Szmek 27bd1b
 #endif
Zbigniew Jędrzejewski-Szmek 27bd1b
         }
Zbigniew Jędrzejewski-Szmek 27bd1b
diff --git a/src/boot/efi/stub.c b/src/boot/efi/stub.c
Zbigniew Jędrzejewski-Szmek 27bd1b
index bab5d46de9..2562228090 100644
Zbigniew Jędrzejewski-Szmek 27bd1b
--- a/src/boot/efi/stub.c
Zbigniew Jędrzejewski-Szmek 27bd1b
+++ b/src/boot/efi/stub.c
Zbigniew Jędrzejewski-Szmek 27bd1b
@@ -94,8 +94,7 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) {
Zbigniew Jędrzejewski-Szmek 27bd1b
                                     loaded_image->LoadOptionsSize, loaded_image->LoadOptions);
Zbigniew Jędrzejewski-Szmek 27bd1b
                 if (EFI_ERROR(err)) {
Zbigniew Jędrzejewski-Szmek 27bd1b
                         Print(L"Unable to add image options measurement: %r", err);
Zbigniew Jędrzejewski-Szmek 27bd1b
-                        uefi_call_wrapper(BS->Stall, 1, 3 * 1000 * 1000);
Zbigniew Jędrzejewski-Szmek 27bd1b
-                        return err;
Zbigniew Jędrzejewski-Szmek 27bd1b
+                        uefi_call_wrapper(BS->Stall, 1, 200 * 1000);
Zbigniew Jędrzejewski-Szmek 27bd1b
                 }
Zbigniew Jędrzejewski-Szmek 27bd1b
 #endif
Zbigniew Jędrzejewski-Szmek 27bd1b
         }