public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/1] imximage: header.length of 4 is valid
@ 2015-09-21 21:02 Troy Kisky
  2015-10-05 23:17 ` Troy Kisky
  2015-10-07 12:03 ` Stefano Babic
  0 siblings, 2 replies; 6+ messages in thread
From: Troy Kisky @ 2015-09-21 21:02 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
---
 tools/imximage.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/imximage.c b/tools/imximage.c
index 97a6880..7c21922 100644
--- a/tools/imximage.c
+++ b/tools/imximage.c
@@ -396,8 +396,8 @@ static void print_hdr_v2(struct imx_header *imx_hdr)
 	dcd_v2_t *dcd_v2 = &hdr_v2->dcd_table;
 	uint32_t size, version;
 
-	size = be16_to_cpu(dcd_v2->header.length) - 8;
-	if (size > (MAX_HW_CFG_SIZE_V2 * sizeof(dcd_addr_data_t))) {
+	size = be16_to_cpu(dcd_v2->header.length);
+	if (size > (MAX_HW_CFG_SIZE_V2 * sizeof(dcd_addr_data_t)) + 8) {
 		fprintf(stderr,
 			"Error: Image corrupt DCD size %d exceed maximum %d\n",
 			(uint32_t)(size / sizeof(dcd_addr_data_t)),
-- 
1.9.1

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

* [U-Boot] [PATCH 1/1] imximage: header.length of 4 is valid
  2015-09-21 21:02 [U-Boot] [PATCH 1/1] imximage: header.length of 4 is valid Troy Kisky
@ 2015-10-05 23:17 ` Troy Kisky
  2015-10-06 11:30   ` stefano babic
  2015-10-07 12:03 ` Stefano Babic
  1 sibling, 1 reply; 6+ messages in thread
From: Troy Kisky @ 2015-10-05 23:17 UTC (permalink / raw)
  To: u-boot

On 9/21/2015 2:02 PM, Troy Kisky wrote:
> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> ---
>  tools/imximage.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/imximage.c b/tools/imximage.c
> index 97a6880..7c21922 100644
> --- a/tools/imximage.c
> +++ b/tools/imximage.c
> @@ -396,8 +396,8 @@ static void print_hdr_v2(struct imx_header *imx_hdr)
>  	dcd_v2_t *dcd_v2 = &hdr_v2->dcd_table;
>  	uint32_t size, version;
>  
> -	size = be16_to_cpu(dcd_v2->header.length) - 8;
> -	if (size > (MAX_HW_CFG_SIZE_V2 * sizeof(dcd_addr_data_t))) {
> +	size = be16_to_cpu(dcd_v2->header.length);
> +	if (size > (MAX_HW_CFG_SIZE_V2 * sizeof(dcd_addr_data_t)) + 8) {
>  		fprintf(stderr,
>  			"Error: Image corrupt DCD size %d exceed maximum %d\n",
>  			(uint32_t)(size / sizeof(dcd_addr_data_t)),
> 

Hi Stefano,


Are there outstanding concerns about applying this patch and then
applying

imximage: fix commands other than write_data

Where you replied
"This patch breaks building boards with SPL:

Building current source for 85 boards (6 threads, 1 job per thread)
       arm:  +   colibri_vf_dtb
+Error: Image corrupt DCD size 536870911 exceed maximum 220
+make[2]: *** [u-boot-dtb.imx] Error 1
+make[1]: *** [u-boot-dtb.imx] Error 2
+make: *** [sub-make] Error 2
       arm:  +   mx6sabresd_spl
+Error: Image corrupt DCD size 536870911 exceed maximum 220
"


Or would you rather that I squash them together?


Thanks
Troy

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

* [U-Boot] [PATCH 1/1] imximage: header.length of 4 is valid
  2015-10-05 23:17 ` Troy Kisky
@ 2015-10-06 11:30   ` stefano babic
  2015-10-06 18:09     ` Troy Kisky
  0 siblings, 1 reply; 6+ messages in thread
From: stefano babic @ 2015-10-06 11:30 UTC (permalink / raw)
  To: u-boot

Hi Troy,

Am 06.10.2015 um 00:17 schrieb Troy Kisky:
> On 9/21/2015 2:02 PM, Troy Kisky wrote:
>> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
>> ---
>>  tools/imximage.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/tools/imximage.c b/tools/imximage.c
>> index 97a6880..7c21922 100644
>> --- a/tools/imximage.c
>> +++ b/tools/imximage.c
>> @@ -396,8 +396,8 @@ static void print_hdr_v2(struct imx_header *imx_hdr)
>>  	dcd_v2_t *dcd_v2 = &hdr_v2->dcd_table;
>>  	uint32_t size, version;
>>  
>> -	size = be16_to_cpu(dcd_v2->header.length) - 8;
>> -	if (size > (MAX_HW_CFG_SIZE_V2 * sizeof(dcd_addr_data_t))) {
>> +	size = be16_to_cpu(dcd_v2->header.length);
>> +	if (size > (MAX_HW_CFG_SIZE_V2 * sizeof(dcd_addr_data_t)) + 8) {
>>  		fprintf(stderr,
>>  			"Error: Image corrupt DCD size %d exceed maximum %d\n",
>>  			(uint32_t)(size / sizeof(dcd_addr_data_t)),
>>
> Hi Stefano,
>
>
> Are there outstanding concerns about applying this patch and then
> applying
>
> imximage: fix commands other than write_data
>
> Where you replied
> "This patch breaks building boards with SPL:
>
> Building current source for 85 boards (6 threads, 1 job per thread)
>        arm:  +   colibri_vf_dtb
> +Error: Image corrupt DCD size 536870911 exceed maximum 220
> +make[2]: *** [u-boot-dtb.imx] Error 1
> +make[1]: *** [u-boot-dtb.imx] Error 2
> +make: *** [sub-make] Error 2
>        arm:  +   mx6sabresd_spl
> +Error: Image corrupt DCD size 536870911 exceed maximum 220
> "
>
>
> Or would you rather that I squash them together?

Yes, please do it - I would like to avoid issues by git bisect.

Thanks,
Stefano

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

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

* [U-Boot] [PATCH 1/1] imximage: header.length of 4 is valid
  2015-10-06 11:30   ` stefano babic
@ 2015-10-06 18:09     ` Troy Kisky
  2015-10-07  8:01       ` Stefano Babic
  0 siblings, 1 reply; 6+ messages in thread
From: Troy Kisky @ 2015-10-06 18:09 UTC (permalink / raw)
  To: u-boot

On 10/6/2015 4:30 AM, stefano babic wrote:
> Hi Troy,
> 
> Am 06.10.2015 um 00:17 schrieb Troy Kisky:
>> On 9/21/2015 2:02 PM, Troy Kisky wrote:
>>> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
>>> ---
>>>  tools/imximage.c | 4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/tools/imximage.c b/tools/imximage.c
>>> index 97a6880..7c21922 100644
>>> --- a/tools/imximage.c
>>> +++ b/tools/imximage.c
>>> @@ -396,8 +396,8 @@ static void print_hdr_v2(struct imx_header *imx_hdr)
>>>  	dcd_v2_t *dcd_v2 = &hdr_v2->dcd_table;
>>>  	uint32_t size, version;
>>>  
>>> -	size = be16_to_cpu(dcd_v2->header.length) - 8;
>>> -	if (size > (MAX_HW_CFG_SIZE_V2 * sizeof(dcd_addr_data_t))) {
>>> +	size = be16_to_cpu(dcd_v2->header.length);
>>> +	if (size > (MAX_HW_CFG_SIZE_V2 * sizeof(dcd_addr_data_t)) + 8) {
>>>  		fprintf(stderr,
>>>  			"Error: Image corrupt DCD size %d exceed maximum %d\n",
>>>  			(uint32_t)(size / sizeof(dcd_addr_data_t)),
>>>
>> Hi Stefano,
>>
>>
>> Are there outstanding concerns about applying this patch and then
>> applying
>>
>> imximage: fix commands other than write_data
>>
>> Where you replied
>> "This patch breaks building boards with SPL:
>>
>> Building current source for 85 boards (6 threads, 1 job per thread)
>>        arm:  +   colibri_vf_dtb
>> +Error: Image corrupt DCD size 536870911 exceed maximum 220
>> +make[2]: *** [u-boot-dtb.imx] Error 1
>> +make[1]: *** [u-boot-dtb.imx] Error 2
>> +make: *** [sub-make] Error 2
>>        arm:  +   mx6sabresd_spl
>> +Error: Image corrupt DCD size 536870911 exceed maximum 220
>> "
>>
>>
>> Or would you rather that I squash them together?
> 
> Yes, please do it - I would like to avoid issues by git bisect.
> 


That is not an issue if you apply "imximage: header.length of 4 is valid" first.

Would you still like it squashed, or a new series, or just use the previous patches ?


Troy

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

* [U-Boot] [PATCH 1/1] imximage: header.length of 4 is valid
  2015-10-06 18:09     ` Troy Kisky
@ 2015-10-07  8:01       ` Stefano Babic
  0 siblings, 0 replies; 6+ messages in thread
From: Stefano Babic @ 2015-10-07  8:01 UTC (permalink / raw)
  To: u-boot

Hi Troy,

On 06/10/2015 20:09, Troy Kisky wrote:
> On 10/6/2015 4:30 AM, stefano babic wrote:
>> Hi Troy,
>>
>> Am 06.10.2015 um 00:17 schrieb Troy Kisky:
>>> On 9/21/2015 2:02 PM, Troy Kisky wrote:
>>>> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
>>>> ---
>>>>  tools/imximage.c | 4 ++--
>>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/tools/imximage.c b/tools/imximage.c
>>>> index 97a6880..7c21922 100644
>>>> --- a/tools/imximage.c
>>>> +++ b/tools/imximage.c
>>>> @@ -396,8 +396,8 @@ static void print_hdr_v2(struct imx_header *imx_hdr)
>>>>  	dcd_v2_t *dcd_v2 = &hdr_v2->dcd_table;
>>>>  	uint32_t size, version;
>>>>  
>>>> -	size = be16_to_cpu(dcd_v2->header.length) - 8;
>>>> -	if (size > (MAX_HW_CFG_SIZE_V2 * sizeof(dcd_addr_data_t))) {
>>>> +	size = be16_to_cpu(dcd_v2->header.length);
>>>> +	if (size > (MAX_HW_CFG_SIZE_V2 * sizeof(dcd_addr_data_t)) + 8) {
>>>>  		fprintf(stderr,
>>>>  			"Error: Image corrupt DCD size %d exceed maximum %d\n",
>>>>  			(uint32_t)(size / sizeof(dcd_addr_data_t)),
>>>>
>>> Hi Stefano,
>>>
>>>
>>> Are there outstanding concerns about applying this patch and then
>>> applying
>>>
>>> imximage: fix commands other than write_data
>>>
>>> Where you replied
>>> "This patch breaks building boards with SPL:
>>>
>>> Building current source for 85 boards (6 threads, 1 job per thread)
>>>        arm:  +   colibri_vf_dtb
>>> +Error: Image corrupt DCD size 536870911 exceed maximum 220
>>> +make[2]: *** [u-boot-dtb.imx] Error 1
>>> +make[1]: *** [u-boot-dtb.imx] Error 2
>>> +make: *** [sub-make] Error 2
>>>        arm:  +   mx6sabresd_spl
>>> +Error: Image corrupt DCD size 536870911 exceed maximum 220
>>> "
>>>
>>>
>>> Or would you rather that I squash them together?
>>
>> Yes, please do it - I would like to avoid issues by git bisect.
>>
> 
> 
> That is not an issue if you apply "imximage: header.length of 4 is valid" first.

Sorry, you're right, of course !
> 
> Would you still like it squashed, or a new series, or just use the previous patches ?

No, I apply both patches.

Regards,
Stefano


-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

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

* [U-Boot] [PATCH 1/1] imximage: header.length of 4 is valid
  2015-09-21 21:02 [U-Boot] [PATCH 1/1] imximage: header.length of 4 is valid Troy Kisky
  2015-10-05 23:17 ` Troy Kisky
@ 2015-10-07 12:03 ` Stefano Babic
  1 sibling, 0 replies; 6+ messages in thread
From: Stefano Babic @ 2015-10-07 12:03 UTC (permalink / raw)
  To: u-boot



On 21/09/2015 23:02, Troy Kisky wrote:
> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> ---
>  tools/imximage.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/imximage.c b/tools/imximage.c
> index 97a6880..7c21922 100644
> --- a/tools/imximage.c
> +++ b/tools/imximage.c
> @@ -396,8 +396,8 @@ static void print_hdr_v2(struct imx_header *imx_hdr)
>  	dcd_v2_t *dcd_v2 = &hdr_v2->dcd_table;
>  	uint32_t size, version;
>  
> -	size = be16_to_cpu(dcd_v2->header.length) - 8;
> -	if (size > (MAX_HW_CFG_SIZE_V2 * sizeof(dcd_addr_data_t))) {
> +	size = be16_to_cpu(dcd_v2->header.length);
> +	if (size > (MAX_HW_CFG_SIZE_V2 * sizeof(dcd_addr_data_t)) + 8) {
>  		fprintf(stderr,
>  			"Error: Image corrupt DCD size %d exceed maximum %d\n",
>  			(uint32_t)(size / sizeof(dcd_addr_data_t)),
> 

Applied to u-boot-imx (fix), thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

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

end of thread, other threads:[~2015-10-07 12:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-21 21:02 [U-Boot] [PATCH 1/1] imximage: header.length of 4 is valid Troy Kisky
2015-10-05 23:17 ` Troy Kisky
2015-10-06 11:30   ` stefano babic
2015-10-06 18:09     ` Troy Kisky
2015-10-07  8:01       ` Stefano Babic
2015-10-07 12:03 ` Stefano Babic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox