From 2c8f2a9ad45023354516d419dc9fda2a4f02812b Mon Sep 17 00:00:00 2001 From: Tamas Ban Date: Mon, 3 Oct 2022 13:19:55 +0200 Subject: [PATCH] fix(rss): determine the size of sw_type in RSS mboot metadata Without setting the correct size of sw_type the metadata won't be propagated to RSS through rss_measured_boot_extend_measurement() API. Signed-off-by: Tamas Ban Change-Id: I4066d4762689c96ac2ac8e8b8db5d2b1f108b550 --- drivers/measured_boot/rss/rss_measured_boot.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/measured_boot/rss/rss_measured_boot.c b/drivers/measured_boot/rss/rss_measured_boot.c index 6cbb4dc47..cf545a705 100644 --- a/drivers/measured_boot/rss/rss_measured_boot.c +++ b/drivers/measured_boot/rss/rss_measured_boot.c @@ -41,10 +41,21 @@ void rss_measured_boot_init(void) /* At this point it is expected that communication channel over MHU * is already initialised by platform init. */ + struct rss_mboot_metadata *metadata_ptr; /* Get pointer to platform's struct rss_mboot_metadata structure */ plat_metadata_ptr = plat_rss_mboot_get_metadata(); assert(plat_metadata_ptr != NULL); + + /* Use a local variable to preserve the value of the global pointer */ + metadata_ptr = plat_metadata_ptr; + + /* Init the non-const members of the metadata structure */ + while (metadata_ptr->id != RSS_MBOOT_INVALID_ID) { + metadata_ptr->sw_type_size = + strlen((const char *)&metadata_ptr->sw_type) + 1; + metadata_ptr++; + } } int rss_mboot_measure_and_record(uintptr_t data_base, uint32_t data_size, -- 2.39.5