From 3b5c1d0ea100933d3fadda82051ede62b5209c89 Mon Sep 17 00:00:00 2001 From: Ye Li Date: Thu, 15 Jun 2023 18:09:16 +0800 Subject: [PATCH] imx: image-container: Fix container header checking Checking container header tag and version is wrong, it causes to fail to bypass invalid container Reviewed-by: Peng Fan Signed-off-by: Ye Li Signed-off-by: Peng Fan --- arch/arm/mach-imx/image-container.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/image-container.c b/arch/arm/mach-imx/image-container.c index 5b059a6429..745de13063 100644 --- a/arch/arm/mach-imx/image-container.c +++ b/arch/arm/mach-imx/image-container.c @@ -31,7 +31,7 @@ int get_container_size(ulong addr, u16 *header_length) u32 max_offset = 0, img_end; phdr = (struct container_hdr *)addr; - if (phdr->tag != 0x87 && phdr->version != 0x0) { + if (phdr->tag != 0x87 || phdr->version != 0x0) { debug("Wrong container header\n"); return -EFAULT; } -- 2.39.5