public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/7] libavb: Handle wrong hashtree_error_mode in avb_append_options()
@ 2018-08-14  0:43 Eugeniu Rosca
  2018-08-14  0:43 ` [U-Boot] [PATCH 2/7] common: avb_verify: Fix invalid 'for' loop condition Eugeniu Rosca
                   ` (7 more replies)
  0 siblings, 8 replies; 24+ messages in thread
From: Eugeniu Rosca @ 2018-08-14  0:43 UTC (permalink / raw)
  To: u-boot

From: Ievgen Maliarenko <ievgen.maliarenko@globallogic.com>

Exit with AVB_SLOT_VERIFY_RESULT_ERROR_INVALID_ARGUMENT
when hashtree_error_mode value passed to avb_append_options()
is unknown (not from AvbHashtreeErrorMode enum).

Otherwise, default value is not handled in the
switch(hashtree_error_mode), which causes below compile warning:

lib/libavb/avb_cmdline.c: In function ‘avb_append_options’:
lib/libavb/avb_cmdline.c:354:13: warning: ‘dm_verity_mode’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     new_ret = avb_replace(
     ~~~~~~~~^~~~~~~~~~~~~~
         slot_data->cmdline, "$(ANDROID_VERITY_MODE)", dm_verity_mode);
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/libavb/avb_cmdline.c:363:8: warning: ‘verity_mode’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   if (!cmdline_append_option(
        ^~~~~~~~~~~~~~~~~~~~~~
           slot_data, "androidboot.veritymode", verity_mode)) {

Signed-off-by: Ievgen Maliarenko <ievgen.maliarenko@globallogic.com>
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
---
 lib/libavb/avb_cmdline.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/libavb/avb_cmdline.c b/lib/libavb/avb_cmdline.c
index 91a6615c740d..d24669927203 100644
--- a/lib/libavb/avb_cmdline.c
+++ b/lib/libavb/avb_cmdline.c
@@ -331,6 +331,9 @@ AvbSlotVerifyResult avb_append_options(
         verity_mode = "logging";
         dm_verity_mode = "ignore_corruption";
         break;
+      default:
+        ret = AVB_SLOT_VERIFY_RESULT_ERROR_INVALID_ARGUMENT;
+        goto out;
     }
     new_ret = avb_replace(
         slot_data->cmdline, "$(ANDROID_VERITY_MODE)", dm_verity_mode);
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2018-08-24 20:09 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-14  0:43 [U-Boot] [PATCH 1/7] libavb: Handle wrong hashtree_error_mode in avb_append_options() Eugeniu Rosca
2018-08-14  0:43 ` [U-Boot] [PATCH 2/7] common: avb_verify: Fix invalid 'for' loop condition Eugeniu Rosca
2018-08-16  8:34   ` Igor Opaniuk
2018-08-24 20:09   ` [U-Boot] [U-Boot, " Tom Rini
2018-08-14  0:43 ` [U-Boot] [PATCH 3/7] common: kconfig: Mark AVB_VERIFY as dependent on PARTITION_UUIDS Eugeniu Rosca
2018-08-16  8:38   ` Igor Opaniuk
2018-08-16 18:25     ` Eugeniu Rosca
2018-08-17 10:33       ` Igor Opaniuk
2018-08-24 20:09   ` [U-Boot] [U-Boot, " Tom Rini
2018-08-14  0:43 ` [U-Boot] [PATCH 4/7] common: avb_verify: Make local data static Eugeniu Rosca
2018-08-16  9:07   ` Igor Opaniuk
2018-08-16 18:34     ` Eugeniu Rosca
2018-08-24 20:09   ` [U-Boot] [U-Boot, " Tom Rini
2018-08-14  0:43 ` [U-Boot] [PATCH 5/7] common: avb_verify: Fix memory leaks Eugeniu Rosca
2018-08-16  9:18   ` Igor Opaniuk
2018-08-24 20:09   ` [U-Boot] [U-Boot,5/7] " Tom Rini
2018-08-14  0:43 ` [U-Boot] [PATCH 6/7] common: avb_verify: Fix never-occurring avb_free(ops_data) Eugeniu Rosca
2018-08-16  7:09   ` Igor Opaniuk
2018-08-24 20:09   ` [U-Boot] [U-Boot, " Tom Rini
2018-08-14  0:43 ` [U-Boot] [PATCH 7/7] common: avb_verify: Fix division by zero in mmc_byte_io() Eugeniu Rosca
2018-08-16  7:10   ` Igor Opaniuk
2018-08-24 20:09   ` [U-Boot] [U-Boot, " Tom Rini
2018-08-16  8:34 ` [U-Boot] [PATCH 1/7] libavb: Handle wrong hashtree_error_mode in avb_append_options() Igor Opaniuk
2018-08-24 20:09 ` [U-Boot] [U-Boot, " Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox