tools: kwbimage: Verify maximal kwbimage header size
PATCH 1/1 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 <[email protected]>
--- tools/kwbimage.c | 3 +++ 1 file changed, 3 insertions(+)
tools/kwbimage.c +3 -0
@@ -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 ;
Signature · 1 line
2.20.1
Quoted 3 lines · Pali Rohár
BootROM loads kwbimage header to L2-SRAM and BootROM reserve only 192 kB for it.
Signed-off-by Pali Rohár <[email protected]>
Reviewed-by Stefan Roese <[email protected]>
Thanks,
Stefan
Quoted 9 lines
--- tools/kwbimage.c | 3 +++ 1 file changed, 3 insertions(+)tools/kwbimage.c +0
-0
tools/kwbimage.c static int kwbimage_verify_header(unsigned char *ptr, int image_size, · line 1977
Quoted 9 lines
tools/kwbimage.c +3
-0@@ -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 ;
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
Quoted 3 lines · Pali Rohár
BootROM loads kwbimage header to L2-SRAM and BootROM reserve only 192 kB for it.
Signed-off-by Pali Rohár <[email protected]>
Applied to u-boot-marvell/master
Thanks,
Stefan
Quoted 9 lines
--- tools/kwbimage.c | 3 +++ 1 file changed, 3 insertions(+)tools/kwbimage.c +0
-0
tools/kwbimage.c static int kwbimage_verify_header(unsigned char *ptr, int image_size, · line 1977
Quoted 9 lines
tools/kwbimage.c +3
-0@@ -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 ;
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]