All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools: kwbimage: Verify maximal kwbimage header size
@ 2022-09-18 16:39 Pali Rohár
  2022-09-19  7:05 ` Stefan Roese
  2022-10-06 10:42 ` Stefan Roese
  0 siblings, 2 replies; 3+ messages in thread
From: Pali Rohár @ 2022-09-18 16:39 UTC (permalink / raw)
  To: Stefan Roese, Marek Behún; +Cc: u-boot

BootROM loads kwbimage header to L2-SRAM and BootROM reserve only 192 kB for it.

Signed-off-by: Pali Rohár <pali@kernel.org>
---
 tools/kwbimage.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/kwbimage.c b/tools/kwbimage.c
index 94b768539222..6abb9f2d5c01 100644
--- 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;
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] tools: kwbimage: Verify maximal kwbimage header size
  2022-09-18 16:39 [PATCH] tools: kwbimage: Verify maximal kwbimage header size Pali Rohár
@ 2022-09-19  7:05 ` Stefan Roese
  2022-10-06 10:42 ` Stefan Roese
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Roese @ 2022-09-19  7:05 UTC (permalink / raw)
  To: Pali Rohár, Marek Behún; +Cc: u-boot

On 18.09.22 18:39, Pali Rohár wrote:
> 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>

Thanks,
Stefan

> ---
>   tools/kwbimage.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/tools/kwbimage.c b/tools/kwbimage.c
> index 94b768539222..6abb9f2d5c01 100644
> --- 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;
>   

Viele Grüße,
Stefan Roese

-- 
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: sr@denx.de

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tools: kwbimage: Verify maximal kwbimage header size
  2022-09-18 16:39 [PATCH] tools: kwbimage: Verify maximal kwbimage header size Pali Rohár
  2022-09-19  7:05 ` Stefan Roese
@ 2022-10-06 10:42 ` Stefan Roese
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Roese @ 2022-10-06 10:42 UTC (permalink / raw)
  To: Pali Rohár, Marek Behún; +Cc: u-boot

On 18.09.22 18:39, Pali Rohár wrote:
> BootROM loads kwbimage header to L2-SRAM and BootROM reserve only 192 kB for it.
> 
> Signed-off-by: Pali Rohár <pali@kernel.org>

Applied to u-boot-marvell/master

Thanks,
Stefan

> ---
>   tools/kwbimage.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/tools/kwbimage.c b/tools/kwbimage.c
> index 94b768539222..6abb9f2d5c01 100644
> --- 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;
>   

Viele Grüße,
Stefan Roese

-- 
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: sr@denx.de

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-06 10:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-18 16:39 [PATCH] tools: kwbimage: Verify maximal kwbimage header size Pali Rohár
2022-09-19  7:05 ` Stefan Roese
2022-10-06 10:42 ` Stefan Roese

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.