]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
fix(rss): determine the size of sw_type in RSS mboot metadata
authorTamas Ban <tamas.ban@arm.com>
Mon, 3 Oct 2022 11:19:55 +0000 (13:19 +0200)
committerTamas Ban <tamas.ban@arm.com>
Fri, 7 Oct 2022 09:32:48 +0000 (11:32 +0200)
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 <tamas.ban@arm.com>
Change-Id: I4066d4762689c96ac2ac8e8b8db5d2b1f108b550

drivers/measured_boot/rss/rss_measured_boot.c

index 6cbb4dc47caed16a376e5930a275668ea556bd3a..cf545a70548575ed6e8ce432b25f377bd7a8269c 100644 (file)
@@ -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,