[coreboot-gerrit] Change in coreboot[master]: security/tpm: Check for NULL pointer

Philipp Deppenwiese (Code Review) gerrit at coreboot.org
Tue Aug 7 20:08:12 CEST 2018


Philipp Deppenwiese has submitted this change and it was merged. ( https://review.coreboot.org/27933 )

Change subject: security/tpm: Check for NULL pointer
......................................................................

security/tpm: Check for NULL pointer

Change bce49c2 (security/tpm: Improve TCPA log generation) missed
checking for NULL pointer before accessing the tcpa_table returned by
tcpa_log_init. This change fixes the boot hang observed on octopus by
ensuring pointer is checked for NULL before using it.

BUG=b:111403731
TEST=Verified that octopus boots up fine.

Change-Id: I2e46197065f8db1dc028a85551546263e60d46b2
Signed-off-by: Furquan Shaikh <furquan at google.com>
Reviewed-on: https://review.coreboot.org/27933
Tested-by: build bot (Jenkins) <no-reply at coreboot.org>
Reviewed-by: Justin TerAvest <teravest at chromium.org>
Reviewed-by: Aaron Durbin <adurbin at chromium.org>
---
M src/security/tpm/tspi/log.c
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  build bot (Jenkins): Verified
  Aaron Durbin: Looks good to me, approved
  Justin TerAvest: Looks good to me, approved



diff --git a/src/security/tpm/tspi/log.c b/src/security/tpm/tspi/log.c
index 0a6655a..17f6f1f 100644
--- a/src/security/tpm/tspi/log.c
+++ b/src/security/tpm/tspi/log.c
@@ -57,6 +57,10 @@
 	struct tcpa_entry *tce;
 
 	tclt = tcpa_log_init();
+
+	if (!tclt)
+		return;
+
 	if (tclt->num_entries == tclt->max_entries) {
 		printk(BIOS_WARNING, "ERROR: TCPA log table is full\n");
 		return;

-- 
To view, visit https://review.coreboot.org/27933
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I2e46197065f8db1dc028a85551546263e60d46b2
Gerrit-Change-Number: 27933
Gerrit-PatchSet: 3
Gerrit-Owner: Furquan Shaikh <furquan at google.com>
Gerrit-Reviewer: Aaron Durbin <adurbin at chromium.org>
Gerrit-Reviewer: Furquan Shaikh <furquan at google.com>
Gerrit-Reviewer: Justin TerAvest <teravest at chromium.org>
Gerrit-Reviewer: Philipp Deppenwiese <zaolin.daisuki at gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply at coreboot.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180807/268ba9fb/attachment.html>


More information about the coreboot-gerrit mailing list