public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/6] fdt: Check error codes returned from fdtlib when loading ITB
@ 2012-08-17 20:34 Joe Hershberger
  2012-08-17 20:34 ` [U-Boot] [PATCH 2/6] fdt: Limit printed hex in fdt print and list commands Joe Hershberger
                   ` (5 more replies)
  0 siblings, 6 replies; 18+ messages in thread
From: Joe Hershberger @ 2012-08-17 20:34 UTC (permalink / raw)
  To: u-boot

Before this patch, error codes returned from fdtlib were ignored and
continued access would cause a crash. Now just check if the image is
truncated and error if so.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
---
 common/image.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/common/image.c b/common/image.c
index 91954ac..4252e63 100644
--- a/common/image.c
+++ b/common/image.c
@@ -2818,6 +2818,11 @@ int fit_image_check_hashes(const void *fit, int image_noffset)
 		}
 	}
 
+	if (noffset == -FDT_ERR_TRUNCATED || noffset == -FDT_ERR_BADSTRUCTURE) {
+		err_msg = " error!\nCorrupted or truncated tree";
+		goto error;
+	}
+
 	return 1;
 
 error:
-- 
1.7.11.5

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

end of thread, other threads:[~2012-10-29  0:54 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-17 20:34 [U-Boot] [PATCH 1/6] fdt: Check error codes returned from fdtlib when loading ITB Joe Hershberger
2012-08-17 20:34 ` [U-Boot] [PATCH 2/6] fdt: Limit printed hex in fdt print and list commands Joe Hershberger
2012-10-25 20:59   ` [U-Boot] [U-Boot, " Tom Rini
2012-10-29  0:54     ` Jerry Van Baren
2012-08-17 20:34 ` [U-Boot] [PATCH 3/6] fdt: Add get commands to fdt Joe Hershberger
2012-10-25 21:08   ` [U-Boot] [U-Boot,3/6] " Tom Rini
2012-08-17 20:34 ` [U-Boot] [PATCH 4/6] fdt: Identify scripts in ITBs as printable strings Joe Hershberger
2012-08-17 20:34 ` [U-Boot] [PATCH 5/6] fdt: Check for a token to skip auto-hash validation Joe Hershberger
2012-08-17 20:34 ` [U-Boot] [PATCH 6/6] fdt: Add a Linux tool for reading values from FDT files Joe Hershberger
2012-08-17 23:35   ` Mike Frysinger
2012-08-20 23:40     ` Joe Hershberger
2012-08-21  0:24       ` Mike Frysinger
2012-08-21  0:51         ` Joe Hershberger
2012-08-21  3:51           ` Mike Frysinger
2012-09-23 23:06             ` Marek Vasut
2012-10-04 17:38 ` [U-Boot] [PATCH 1/6] fdt: Check error codes returned from fdtlib when loading ITB Joe Hershberger
2012-10-08 23:45   ` Jerry Van Baren
2012-10-08 23:51     ` Tom Rini

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