From 74a00b9cec6ce4f1a92d6ade4baa305dbe9e5ffb Mon Sep 17 00:00:00 2001 From: Yu-Ping Wu Date: Wed, 31 Aug 2022 14:52:46 +0800 Subject: security/vboot/tpm: Avoid duplicate vb2api_secdata_firmware_create calls For TPM2, vb2api_secdata_firmware_create() is already called from setup_firmware_space() from _factory_initialize_tpm(). Therefore move the duplicate call from factory_initialize_tpm() to TPM1's _factory_initialize_tpm(). Change-Id: I892df65c847e1aeeabef8a7578bec743b639a127 Signed-off-by: Yu-Ping Wu Reviewed-on: https://review.coreboot.org/c/coreboot/+/67219 Tested-by: build bot (Jenkins) Reviewed-by: Aseda Aboagye Reviewed-by: Julius Werner --- src/security/vboot/secdata_tpm.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/security/vboot') diff --git a/src/security/vboot/secdata_tpm.c b/src/security/vboot/secdata_tpm.c index 450c681c06..3ad7fc8a75 100644 --- a/src/security/vboot/secdata_tpm.c +++ b/src/security/vboot/secdata_tpm.c @@ -488,6 +488,7 @@ static uint32_t _factory_initialize_tpm(struct vb2_context *ctx) TPM_PERMANENT_FLAGS pflags; uint32_t result; + vb2api_secdata_firmware_create(ctx); vb2api_secdata_kernel_create_v0(ctx); result = tlcl_get_permanent_flags(&pflags); @@ -558,12 +559,6 @@ static uint32_t factory_initialize_tpm(struct vb2_context *ctx) { uint32_t result; - /* - * Set initial values of secdata_firmware space. - * kernel space is created in _factory_initialize_tpm(). - */ - vb2api_secdata_firmware_create(ctx); - VBDEBUG("TPM: factory initialization\n"); /* -- cgit v1.2.3