Skip to contentSkip to conversation

smegw01: Fix inverted CONFIG_SYS_BOOT_LOCKED logic

PATCH In review Fabio Estevam 2 participants 3 messages Sep 25, 2023 – Sep 29, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 smegw01: Fix inverted CONFIG_SYS_BOOT_LOCKED logic

From: Eduard Strehlau <[email protected]>

CONFIG_SYS_BOOT_LOCKED means that a restricted boot environment will be used. In this case, hab_auth_img_or_fail should be called to prevent U-Boot to continue running when the fitImage authentication fails.

Fix the logic accordingly.

Additionally, select CONFIG_SYS_BOOT_LOCKED by default.

---
Hi Tom,

We have just identified this bug.

Could you please pick this one directly for U-Boot 2023.10?

Thanks

 board/storopack/smegw01/smegw01.env | 4 ++--
 configs/smegw01_defconfig           | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
board/storopack/smegw01/smegw01.env +2 -2
index 528310dd81..93de866910 100644
@@ -67,9 +67,9 @@ mmcboot=
 		run altbootcmd;
 	fi;
 #ifdef CONFIG_SYS_BOOT_LOCKED
-	hab_auth_img ${fileaddr} ${filesize};
-#else
 	hab_auth_img_or_fail ${fileaddr} ${filesize};
+#else
+	hab_auth_img ${fileaddr} ${filesize};
 #endif
 	run mmcargs;
 	if bootm; then
configs/smegw01_defconfig +1 -1
index 616038387e..03d403ddc8 100644
@@ -7,7 +7,7 @@ CONFIG_ENV_OFFSET=0x100000
 CONFIG_DM_GPIO=y
 CONFIG_DEFAULT_DEVICE_TREE="imx7d-smegw01"
 CONFIG_TARGET_SMEGW01=y
-# CONFIG_SYS_BOOT_LOCKED is not set
+CONFIG_SYS_BOOT_LOCKED=y
 CONFIG_ENV_OFFSET_REDUND=0x110000
 CONFIG_ARMV7_BOOT_SEC_DEFAULT=y
 # CONFIG_ARMV7_VIRT is not set
Signature · 1 line
2.41.0
#1 lore raw
Quoted 10 lines · Fabio Estevam

From: Eduard Strehlau <[email protected]>

CONFIG_SYS_BOOT_LOCKED means that a restricted boot environment will be used. In this case, hab_auth_img_or_fail should be called to prevent U-Boot to continue running when the fitImage authentication fails.

Fix the logic accordingly.

Additionally, select CONFIG_SYS_BOOT_LOCKED by default.

Quoted 8 lines

---
Hi Tom,

We have just identified this bug.

Could you please pick this one directly for U-Boot 2023.10?

OK.

Signature · 1 line
Tom
#2 lore raw
In reply to Fabio Estevam
Quoted 6 lines · Fabio Estevam

From: Eduard Strehlau <[email protected]>

CONFIG_SYS_BOOT_LOCKED means that a restricted boot environment will be used. In this case, hab_auth_img_or_fail should be called to prevent U-Boot to continue running when the fitImage authentication fails.

Quoted 6 lines

Fix the logic accordingly.

Additionally, select CONFIG_SYS_BOOT_LOCKED by default.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom