All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] common: spl: spl_fit.c: report an error on hash check fail
@ 2020-11-24 15:15 Philippe Reynes
  2020-11-30 20:12 ` Simon Glass
  2021-01-18 13:01 ` Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Philippe Reynes @ 2020-11-24 15:15 UTC (permalink / raw)
  To: u-boot

When the hash check fails on a loadable image, the SPL/TPL simply
jump to the next one. This commit changes this behaviour, when the
hash check fails on a loadable image, the function spl_load_simple_fit
stops and report an error.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
---
 common/spl/spl_fit.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index 6418062b93..0de4a2b543 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -667,8 +667,11 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
 
 		ret = spl_load_fit_image(info, sector, fit, base_offset, node,
 					 &image_info);
-		if (ret < 0)
-			continue;
+		if (ret < 0) {
+			printf("%s: can't load image loadables index %d (ret = %d)\n",
+			       __func__, index, ret);
+			return ret;
+		}
 
 		if (!spl_fit_image_get_os(fit, node, &os_type))
 			debug("Loadable is %s\n", genimg_get_os_name(os_type));
-- 
2.17.1

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

* [PATCH] common: spl: spl_fit.c: report an error on hash check fail
  2020-11-24 15:15 [PATCH] common: spl: spl_fit.c: report an error on hash check fail Philippe Reynes
@ 2020-11-30 20:12 ` Simon Glass
  2021-01-18 13:01 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2020-11-30 20:12 UTC (permalink / raw)
  To: u-boot

On Tue, 24 Nov 2020 at 08:15, Philippe Reynes
<philippe.reynes@softathome.com> wrote:
>
> When the hash check fails on a loadable image, the SPL/TPL simply
> jump to the next one. This commit changes this behaviour, when the
> hash check fails on a loadable image, the function spl_load_simple_fit
> stops and report an error.
>
> Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
> ---
>  common/spl/spl_fit.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

This should have a test. We have sandbox SPL test support now so it
should not be too hard.

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

* [PATCH] common: spl: spl_fit.c: report an error on hash check fail
  2020-11-24 15:15 [PATCH] common: spl: spl_fit.c: report an error on hash check fail Philippe Reynes
  2020-11-30 20:12 ` Simon Glass
@ 2021-01-18 13:01 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2021-01-18 13:01 UTC (permalink / raw)
  To: u-boot

On Tue, Nov 24, 2020 at 04:15:05PM +0100, Philippe Reynes wrote:

> When the hash check fails on a loadable image, the SPL/TPL simply
> jump to the next one. This commit changes this behaviour, when the
> hash check fails on a loadable image, the function spl_load_simple_fit
> stops and report an error.
> 
> Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210118/212b3d02/attachment.sig>

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

end of thread, other threads:[~2021-01-18 13:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-24 15:15 [PATCH] common: spl: spl_fit.c: report an error on hash check fail Philippe Reynes
2020-11-30 20:12 ` Simon Glass
2021-01-18 13:01 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.