summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2022-01-12 20:20:43 +0300
committerStefan Roese <sr@denx.de>2022-01-14 13:39:16 +0300
commit78d997f98bc049bf62c8f4c3e39a30fdbdef2fd8 (patch)
tree4083d553600592efe0e83b7c6bb8cfd76e0ef66b /tools
parent252e7c3a24fefdf88dfa3fff87e8dc4d0c7aa9cc (diff)
downloadu-boot-78d997f98bc049bf62c8f4c3e39a30fdbdef2fd8.tar.xz
tools: kwbimage: Check for maximal kwbimage header size
BootROM loads kwbimage header to L2-SRAM and BootROM reserve only 192 kB for it. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'tools')
-rw-r--r--tools/kwbimage.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/kwbimage.c b/tools/kwbimage.c
index a5b518f60b..ce053a4a5a 100644
--- a/tools/kwbimage.c
+++ b/tools/kwbimage.c
@@ -2033,6 +2033,11 @@ static int kwbimage_generate(struct image_tool_params *params,
free(image_cfg);
exit(EXIT_FAILURE);
}
+ if (alloc_len > 192*1024) {
+ fprintf(stderr, "Header is too big (%u bytes), maximal kwbimage header size is %u bytes\n", alloc_len, 192*1024);
+ free(image_cfg);
+ exit(EXIT_FAILURE);
+ }
break;
default: