public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] ARM: imx: hab: panic on authentication failure
@ 2020-05-30 18:29 Marek Vasut
  2020-05-30 18:31 ` Fabio Estevam
  2020-08-04  8:52 ` sbabic at denx.de
  0 siblings, 2 replies; 10+ messages in thread
From: Marek Vasut @ 2020-05-30 18:29 UTC (permalink / raw)
  To: u-boot

Instead of hang()ing the system and thus disallowing any automated
recovery possibility from a HAB authentication failure, panic() .
The panic() function can be configured to hang() the system after
printing an error message, however the default is to reset the
system instead.

This allows redundant boot to work correctly. In case the primary
or secondary image cannot be authenticated, the system reboots and
bootrom can try to start the other one.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: NXP i.MX U-Boot Team <uboot-imx@nxp.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
---
 arch/arm/mach-imx/spl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c
index 1a231c67f5..76a5f7aca6 100644
--- a/arch/arm/mach-imx/spl.c
+++ b/arch/arm/mach-imx/spl.c
@@ -293,8 +293,7 @@ __weak void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
 						CSF_PAD_SIZE, offset)) {
 			image_entry();
 		} else {
-			puts("spl: ERROR:  image authentication fail\n");
-			hang();
+			panic("spl: ERROR:  image authentication fail\n");
 		}
 	}
 }
@@ -320,8 +319,7 @@ void board_spl_fit_post_load(ulong load_addr, size_t length)
 	if (imx_hab_authenticate_image(load_addr,
 				       offset + IVT_SIZE + CSF_PAD_SIZE,
 				       offset)) {
-		puts("spl: ERROR:  image authentication unsuccessful\n");
-		hang();
+		panic("spl: ERROR:  image authentication unsuccessful\n");
 	}
 }
 #endif
-- 
2.25.1

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

end of thread, other threads:[~2020-08-04  8:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-30 18:29 [PATCH] ARM: imx: hab: panic on authentication failure Marek Vasut
2020-05-30 18:31 ` Fabio Estevam
2020-05-30 20:14   ` Patrick Wildt
2020-05-30 20:29     ` Marek Vasut
2020-05-30 20:53       ` Patrick Wildt
2020-05-31 15:38         ` Marek Vasut
2020-05-31 15:53           ` Patrick Wildt
2020-05-31 16:51             ` Marek Vasut
2020-05-31 17:02               ` Patrick Wildt
2020-08-04  8:52 ` sbabic at denx.de

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