tools: kwbimage: Verify 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>
This commit is contained in:
parent
1ba0018218
commit
cbd0043e20
@ -1969,6 +1969,9 @@ static int kwbimage_verify_header(unsigned char *ptr, int image_size,
|
|||||||
uint32_t size;
|
uint32_t size;
|
||||||
uint8_t csum;
|
uint8_t csum;
|
||||||
|
|
||||||
|
if (header_size > 192*1024)
|
||||||
|
return -FDT_ERR_BADSTRUCTURE;
|
||||||
|
|
||||||
if (header_size > image_size)
|
if (header_size > image_size)
|
||||||
return -FDT_ERR_BADSTRUCTURE;
|
return -FDT_ERR_BADSTRUCTURE;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user