projects
/
platform
/
kernel
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1ba0018
)
tools: kwbimage: Verify maximal kwbimage header size
author
Pali Rohár
<pali@kernel.org>
Sun, 18 Sep 2022 16:39:18 +0000
(18:39 +0200)
committer
Stefan Roese
<sr@denx.de>
Thu, 6 Oct 2022 08:15:35 +0000
(10:15 +0200)
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>
tools/kwbimage.c
patch
|
blob
|
history
diff --git
a/tools/kwbimage.c
b/tools/kwbimage.c
index
94b7685
..
6abb9f2
100644
(file)
--- a/
tools/kwbimage.c
+++ b/
tools/kwbimage.c
@@
-1969,6
+1969,9
@@
static int kwbimage_verify_header(unsigned char *ptr, int image_size,
uint32_t size;
uint8_t csum;
+ if (header_size > 192*1024)
+ return -FDT_ERR_BADSTRUCTURE;
+
if (header_size > image_size)
return -FDT_ERR_BADSTRUCTURE;