[Skiboot] [PATCH v2 13/14] libstb/stb.c: fix trustedboot abort

Claudio Carvalho cclaudio at linux.vnet.ibm.com
Thu Aug 31 17:24:44 AEST 2017


Trustedboot doesn't halt the boot, secureboot does.

This replaces the abort calls in the trustedboot code by simple return
calls.

Signed-off-by: Claudio Carvalho <cclaudio at linux.vnet.ibm.com>
---
 libstb/stb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/libstb/stb.c b/libstb/stb.c
index f0eb108..cf40b2c 100644
--- a/libstb/stb.c
+++ b/libstb/stb.c
@@ -363,7 +363,7 @@ int tb_measure(enum resource_id id, void *buf, size_t len)
 		digestp = stb_sw_payload_hash(buf, len);
 		if(!digestp) {
 			prlog(PR_EMERG, "STB Container is corrupt, can't find hash\n");
-			abort();
+			return -1;
 		}
 
 		c1vc->sha512((void*) c1vc->sha512_addr,
@@ -377,9 +377,7 @@ int tb_measure(enum resource_id id, void *buf, size_t len)
 			stb_print_data(digestp, TPM_ALG_SHA256_SIZE);
 			prlog(PR_ALERT, "STB: Computed hash (on %lx bytes):\n", len);
 			stb_print_data(digest, TPM_ALG_SHA256_SIZE);
-
-			if (secure_mode)
-				abort();
+			return -1;
 		}
 	} else {
 		c1vc->sha512((void*) c1vc->sha512_addr, buf, len, digest);
-- 
2.7.4



More information about the Skiboot mailing list