Skip to contentSkip to conversation

avb: verify: return fail if there is no uuid in partition info

PATCH New Kever Yang 2 participants 2 messages Sep 2, 2019

lore
Share & tools
lore

Kever Yang

author
#0 lore raw

PATCH 1/1 avb: verify: return fail if there is no uuid in partition info

There is not always have uuid in disk_partition_t, we can only get from partitions info when PARTITION_UUIDS is available.

---

 common/avb_verify.c | 4 ++++
 1 file changed, 4 insertions(+)
common/avb_verify.c +4 -0
index 36898a610f..314c5f7a3e 100644
@@ -803,6 +803,7 @@ static AvbIOResult get_unique_guid_for_partition(AvbOps *ops,
 						 char *guid_buf,
 						 size_t guid_buf_size)
 {
+#if CONFIG_IS_ENABLED(PARTITION_UUIDS)
 	struct mmc_part *part;
 	size_t uuid_size;
 
@@ -818,6 +819,9 @@ static AvbIOResult get_unique_guid_for_partition(AvbOps *ops,
 	guid_buf[uuid_size - 1] = 0;
 
 	return AVB_IO_RESULT_OK;
+#else
+	return AVB_IO_RESULT_ERROR_IO;
+#endif
 }
 
 /**
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 avb: verify: return fail if there is no uuid in partition info

Hi Kever,

Quoted 33 lines · Kever Yang

There is not always have uuid in disk_partition_t, we can only get from partitions info when PARTITION_UUIDS is available.

---

 common/avb_verify.c | 4 ++++
 1 file changed, 4 insertions(+)
common/avb_verify.c +4 -1
index 36898a610f..314c5f7a3e 100644
@@ -803,6 +803,7 @@ static AvbIOResult get_unique_guid_for_partition(AvbOps *ops,
                                                 char *guid_buf,
                                                 size_t guid_buf_size)
 {
+#if CONFIG_IS_ENABLED(PARTITION_UUIDS)
        struct mmc_part *part;
        size_t uuid_size;
 
@@ -818,6 +819,9 @@ static AvbIOResult get_unique_guid_for_partition(AvbOps *ops,
        guid_buf[uuid_size - 1] = 0;
 
        return AVB_IO_RESULT_OK;
+#else
+       return AVB_IO_RESULT_ERROR_IO;
+#endif
 }
 
 /**
--
Quoted 2 lines

2.17.1

get_unique_guid_for_partition() is mandatory for proper avb_slot_verify() functioning, so having stub which returns AVB_IO_RESULT_ERROR_IO makes no sense ( avb_sub_cmdline() will be always failing). IMHO that would be better to imply/add dependency on PARTITION_UUIDS in lib/Kconfig.

You can just move dependency on PARTITION_UUIDS from common/Kconfig (AVB_VERIFY symbol) to lib/Kconfig for LIBAVB symbol.

Thanks!

Signature · 8 lines
Best regards - Freundliche Grüsse - Meilleures salutations

Igor Opaniuk

mailto: igor.opaniuk at gmail.com
skype: igor.opanyuk
+380 (93) 836 40 67
http://ua.linkedin.com/in/iopaniuk