[PATCH 2/7] uImage: Fix uImage_load() for little-endian machines

David Woodhouse dwmw2 at infradead.org
Wed Mar 8 14:41:09 PST 2017


From: David Woodhouse <dwmw at amazon.co.uk>

Signed-off-by: David Woodhouse <dwmw at amazon.co.uk>
---
 kexec/kexec-uImage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kexec/kexec-uImage.c b/kexec/kexec-uImage.c
index 667cd93..49f266a 100644
--- a/kexec/kexec-uImage.c
+++ b/kexec/kexec-uImage.c
@@ -236,7 +236,7 @@ int uImage_load(const unsigned char *buf, off_t len, struct Image_info *image)
 {
 	const struct image_header *header = (const struct image_header *)buf;
 	const unsigned char *img_buf = buf + sizeof(struct image_header);
-	off_t img_len = header->ih_size;
+	off_t img_len = be32_to_cpu(header->ih_size);
 
 	/*
 	 * Prevent loading a modified image.
-- 
2.9.3




More information about the kexec mailing list