aboutsummaryrefslogtreecommitdiff
path: root/libstb
diff options
context:
space:
mode:
authorMauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com>2020-04-30 20:01:28 -0300
committerOliver O'Halloran <oohall@gmail.com>2020-05-26 14:30:29 +1000
commit59314f312278548f2ec9f9a34ec11a67e470ab24 (patch)
tree7078a56c41ca58d06fa94fcc6f6b9cc4718c3dc3 /libstb
parent0f1937ef40fca0c3212a9dff1010b832a24fb063 (diff)
downloadskiboot-59314f312278548f2ec9f9a34ec11a67e470ab24.zip
skiboot-59314f312278548f2ec9f9a34ec11a67e470ab24.tar.gz
skiboot-59314f312278548f2ec9f9a34ec11a67e470ab24.tar.bz2
libstb: Don't exit trustedboot services multiple times
For the very specific scenario when the fast-reboot is used, we see multiple error messages regarding the trusteboot measurements not being done. The way fast-reboot works is performing just fundamental operations, like PCI initialization, to get skiboot into good shape to boot kernel, and later the host's Kernel. That means fast-reboot contains data structures filled since last full reboot. In this process trustedboot is not re-initialized when, but it still tries to perform the STB measurements and event logging done in trustedboot_exit_services, showing multiple failure messages. This patch avoids that situation by returning earlier and logging that trustedboot already exited. If eventually something changes and trustedboot gets re-initialized during fast-reboot this patch also set boot_services_exited to false after every initialization so we always exit trustedboot whenever it get initialized. Signed-off-by: Mauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Diffstat (limited to 'libstb')
-rw-r--r--libstb/trustedboot.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libstb/trustedboot.c b/libstb/trustedboot.c
index 413862e..b1f86cc 100644
--- a/libstb/trustedboot.c
+++ b/libstb/trustedboot.c
@@ -116,6 +116,7 @@ void trustedboot_init(void)
tpm_init();
trusted_init = true;
+ boot_services_exited = false;
}
int trustedboot_exit_boot_services(void)
@@ -124,11 +125,15 @@ int trustedboot_exit_boot_services(void)
int rc = 0;
bool failed = false;
- boot_services_exited = true;
-
if (!trusted_mode)
goto out_free;
+ if (boot_services_exited) {
+ prlog(PR_WARNING, "Trusted boot services exited before.\n");
+ goto out_free;
+ }
+
+ boot_services_exited = true;
#ifdef STB_DEBUG
prlog(PR_NOTICE, "ev_separator.event: %s\n", ev_separator.event);
prlog(PR_NOTICE, "ev_separator.sha1:\n");