All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] cmd_fdt: save fdtaddr in hex format
@ 2015-07-03 17:29 Sudeep Holla
  2015-07-03 23:06 ` Simon Glass
  2015-07-10 16:18 ` Sudeep Holla
  0 siblings, 2 replies; 8+ messages in thread
From: Sudeep Holla @ 2015-07-03 17:29 UTC (permalink / raw)
  To: u-boot

Commit 90fbee3e4051 ("cmd_fdt: Actually fix fdt command in sandbox")
changed the format(from hex address to unsigned long) in which "fdtaddr"
is saved . However do_fdt continues reads the "fdtaddr" assuming it to
be in hex format. This may lead to fdt being either loaded or attempted
to load at erroneous address generating fault if the address is out of
memory.

This patch changes back the format to hex while saving the "fdtaddr"
as it was done before.

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Hua Yanghao <huayanghao@gmail.com>
Cc: Heiko Schocher <hs@denx.de>
---
 common/cmd_fdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Hi,

You will see my signoff missing and it's intentional as I officially
can't contribute to Uboot. I found this issue and it's been there for a
while now, so thought of atleast reporting it(with a patch). So if anyone
can review and submit this or any appropriate fix that would be great.
I see this issue on vexpress TC2.

Regards,
Sudeep

diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c
index 682b6553958f..4c18962d8532 100644
--- a/common/cmd_fdt.c
+++ b/common/cmd_fdt.c
@@ -45,7 +45,7 @@ void set_working_fdt_addr(ulong addr)

 	buf = map_sysmem(addr, 0);
 	working_fdt = buf;
-	setenv_ulong("fdtaddr", addr);
+	setenv_hex("fdtaddr", addr);
 }

 /*
--
1.9.1

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

* [U-Boot] [PATCH] cmd_fdt: save fdtaddr in hex format
  2015-07-03 17:29 [U-Boot] [PATCH] cmd_fdt: save fdtaddr in hex format Sudeep Holla
@ 2015-07-03 23:06 ` Simon Glass
  2015-07-06  8:47   ` Sudeep Holla
  2015-07-10 16:18 ` Sudeep Holla
  1 sibling, 1 reply; 8+ messages in thread
From: Simon Glass @ 2015-07-03 23:06 UTC (permalink / raw)
  To: u-boot

Hi Sudeep,

On 3 July 2015 at 11:29, Sudeep Holla <sudeep.holla@arm.com> wrote:
> Commit 90fbee3e4051 ("cmd_fdt: Actually fix fdt command in sandbox")
> changed the format(from hex address to unsigned long) in which "fdtaddr"
> is saved . However do_fdt continues reads the "fdtaddr" assuming it to
> be in hex format. This may lead to fdt being either loaded or attempted
> to load at erroneous address generating fault if the address is out of
> memory.
>
> This patch changes back the format to hex while saving the "fdtaddr"
> as it was done before.
>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Tom Rini <trini@konsulko.com>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Hua Yanghao <huayanghao@gmail.com>
> Cc: Heiko Schocher <hs@denx.de>
> ---
>  common/cmd_fdt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Hi,
>
> You will see my signoff missing and it's intentional as I officially
> can't contribute to Uboot. I found this issue and it's been there for a
> while now, so thought of atleast reporting it(with a patch). So if anyone
> can review and submit this or any appropriate fix that would be great.
> I see this issue on vexpress TC2.

We can't take this without a sign-off - what stops you from adding it exactly?

The patch looks correct to me.

Regards,
Simon

>
> Regards,
> Sudeep
>
> diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c
> index 682b6553958f..4c18962d8532 100644
> --- a/common/cmd_fdt.c
> +++ b/common/cmd_fdt.c
> @@ -45,7 +45,7 @@ void set_working_fdt_addr(ulong addr)
>
>         buf = map_sysmem(addr, 0);
>         working_fdt = buf;
> -       setenv_ulong("fdtaddr", addr);
> +       setenv_hex("fdtaddr", addr);
>  }
>
>  /*
> --
> 1.9.1
>

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

* [U-Boot] [PATCH] cmd_fdt: save fdtaddr in hex format
  2015-07-03 23:06 ` Simon Glass
@ 2015-07-06  8:47   ` Sudeep Holla
  0 siblings, 0 replies; 8+ messages in thread
From: Sudeep Holla @ 2015-07-06  8:47 UTC (permalink / raw)
  To: u-boot

Hi Simon,

On 04/07/15 00:06, Simon Glass wrote:
> Hi Sudeep,
>
> On 3 July 2015 at 11:29, Sudeep Holla <sudeep.holla@arm.com> wrote:
>> Commit 90fbee3e4051 ("cmd_fdt: Actually fix fdt command in sandbox")
>> changed the format(from hex address to unsigned long) in which "fdtaddr"
>> is saved . However do_fdt continues reads the "fdtaddr" assuming it to
>> be in hex format. This may lead to fdt being either loaded or attempted
>> to load at erroneous address generating fault if the address is out of
>> memory.
>>
>> This patch changes back the format to hex while saving the "fdtaddr"
>> as it was done before.
>>
>> Cc: Linus Walleij <linus.walleij@linaro.org>
>> Cc: Tom Rini <trini@konsulko.com>
>> Cc: Simon Glass <sjg@chromium.org>
>> Cc: Hua Yanghao <huayanghao@gmail.com>
>> Cc: Heiko Schocher <hs@denx.de>
>> ---
>>   common/cmd_fdt.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> Hi,
>>
>> You will see my signoff missing and it's intentional as I officially
>> can't contribute to Uboot. I found this issue and it's been there for a
>> while now, so thought of atleast reporting it(with a patch). So if anyone
>> can review and submit this or any appropriate fix that would be great.
>> I see this issue on vexpress TC2.
>
> We can't take this without a sign-off - what stops you from adding it exactly?
>

Unfortunately it's not in the list of legally approved projects I can
contribute. So I am bound not to do so legally.

Hi Linus,

Since you did a lot work on vexpress/Juno quite recently on ARM's
request, can you cook up a similar patch to fix the above mentioned
issue if that's OK for you ?

Regards,
Sudeep

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

* [U-Boot] [PATCH] cmd_fdt: save fdtaddr in hex format
  2015-07-03 17:29 [U-Boot] [PATCH] cmd_fdt: save fdtaddr in hex format Sudeep Holla
  2015-07-03 23:06 ` Simon Glass
@ 2015-07-10 16:18 ` Sudeep Holla
  2015-07-10 23:08   ` Simon Glass
  2015-07-16 13:26   ` Linus Walleij
  1 sibling, 2 replies; 8+ messages in thread
From: Sudeep Holla @ 2015-07-10 16:18 UTC (permalink / raw)
  To: u-boot

Commit 90fbee3e4051 ("cmd_fdt: Actually fix fdt command in sandbox")
changed the format(from hex address to unsigned long) in which "fdtaddr"
is saved . However do_fdt continues reads the "fdtaddr" assuming it to
be in hex format. This may lead to fdt being either loaded or attempted
to load at erroneous address generating fault if the address is out of
memory.

This patch changes back the format to hex while saving the "fdtaddr"
as it was done before.

Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Hua Yanghao <huayanghao@gmail.com>
Cc: Heiko Schocher <hs@denx.de>
---
 common/cmd_fdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Reposting this time with my signoff as it turns out I can legally do so.

diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c
index 682b6553958f..4c18962d8532 100644
--- a/common/cmd_fdt.c
+++ b/common/cmd_fdt.c
@@ -45,7 +45,7 @@ void set_working_fdt_addr(ulong addr)
 
 	buf = map_sysmem(addr, 0);
 	working_fdt = buf;
-	setenv_ulong("fdtaddr", addr);
+	setenv_hex("fdtaddr", addr);
 }
 
 /*
-- 
1.9.1

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

* [U-Boot] [PATCH] cmd_fdt: save fdtaddr in hex format
  2015-07-10 16:18 ` Sudeep Holla
@ 2015-07-10 23:08   ` Simon Glass
  2015-07-16 13:26   ` Linus Walleij
  1 sibling, 0 replies; 8+ messages in thread
From: Simon Glass @ 2015-07-10 23:08 UTC (permalink / raw)
  To: u-boot

On 10 July 2015 at 10:18, Sudeep Holla <sudeep.holla@arm.com> wrote:
>
> Commit 90fbee3e4051 ("cmd_fdt: Actually fix fdt command in sandbox")
> changed the format(from hex address to unsigned long) in which "fdtaddr"
> is saved . However do_fdt continues reads the "fdtaddr" assuming it to
> be in hex format. This may lead to fdt being either loaded or attempted
> to load at erroneous address generating fault if the address is out of
> memory.
>
> This patch changes back the format to hex while saving the "fdtaddr"
> as it was done before.
>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Tom Rini <trini@konsulko.com>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Hua Yanghao <huayanghao@gmail.com>
> Cc: Heiko Schocher <hs@denx.de>
> ---
>  common/cmd_fdt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Reposting this time with my signoff as it turns out I can legally do so.
>

Great!

- Simon

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

* [U-Boot] [PATCH] cmd_fdt: save fdtaddr in hex format
  2015-07-10 16:18 ` Sudeep Holla
  2015-07-10 23:08   ` Simon Glass
@ 2015-07-16 13:26   ` Linus Walleij
  2015-07-16 16:34     ` Simon Glass
  1 sibling, 1 reply; 8+ messages in thread
From: Linus Walleij @ 2015-07-16 13:26 UTC (permalink / raw)
  To: u-boot

On Fri, Jul 10, 2015 at 6:18 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:

> Commit 90fbee3e4051 ("cmd_fdt: Actually fix fdt command in sandbox")
> changed the format(from hex address to unsigned long) in which "fdtaddr"
> is saved . However do_fdt continues reads the "fdtaddr" assuming it to
> be in hex format. This may lead to fdt being either loaded or attempted
> to load at erroneous address generating fault if the address is out of
> memory.
>
> This patch changes back the format to hex while saving the "fdtaddr"
> as it was done before.
>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Tom Rini <trini@konsulko.com>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Hua Yanghao <huayanghao@gmail.com>
> Cc: Heiko Schocher <hs@denx.de>

Looks like the right fix:
Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* [U-Boot] [PATCH] cmd_fdt: save fdtaddr in hex format
  2015-07-16 13:26   ` Linus Walleij
@ 2015-07-16 16:34     ` Simon Glass
  2015-07-20 13:25       ` Simon Glass
  0 siblings, 1 reply; 8+ messages in thread
From: Simon Glass @ 2015-07-16 16:34 UTC (permalink / raw)
  To: u-boot

On 16 July 2015 at 07:26, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Fri, Jul 10, 2015 at 6:18 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>
>> Commit 90fbee3e4051 ("cmd_fdt: Actually fix fdt command in sandbox")
>> changed the format(from hex address to unsigned long) in which "fdtaddr"
>> is saved . However do_fdt continues reads the "fdtaddr" assuming it to
>> be in hex format. This may lead to fdt being either loaded or attempted
>> to load at erroneous address generating fault if the address is out of
>> memory.
>>
>> This patch changes back the format to hex while saving the "fdtaddr"
>> as it was done before.
>>
>> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
>> Cc: Linus Walleij <linus.walleij@linaro.org>
>> Cc: Tom Rini <trini@konsulko.com>
>> Cc: Simon Glass <sjg@chromium.org>
>> Cc: Hua Yanghao <huayanghao@gmail.com>
>> Cc: Heiko Schocher <hs@denx.de>
>
> Looks like the right fix:
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
>
> Yours,
> Linus Walleij

Acked-by: Simon Glass <sjg@chromium.org>

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

* [U-Boot] [PATCH] cmd_fdt: save fdtaddr in hex format
  2015-07-16 16:34     ` Simon Glass
@ 2015-07-20 13:25       ` Simon Glass
  0 siblings, 0 replies; 8+ messages in thread
From: Simon Glass @ 2015-07-20 13:25 UTC (permalink / raw)
  To: u-boot

On 16 July 2015 at 10:34, Simon Glass <sjg@chromium.org> wrote:
> On 16 July 2015 at 07:26, Linus Walleij <linus.walleij@linaro.org> wrote:
>> On Fri, Jul 10, 2015 at 6:18 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>>
>>> Commit 90fbee3e4051 ("cmd_fdt: Actually fix fdt command in sandbox")
>>> changed the format(from hex address to unsigned long) in which "fdtaddr"
>>> is saved . However do_fdt continues reads the "fdtaddr" assuming it to
>>> be in hex format. This may lead to fdt being either loaded or attempted
>>> to load at erroneous address generating fault if the address is out of
>>> memory.
>>>
>>> This patch changes back the format to hex while saving the "fdtaddr"
>>> as it was done before.
>>>
>>> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
>>> Cc: Linus Walleij <linus.walleij@linaro.org>
>>> Cc: Tom Rini <trini@konsulko.com>
>>> Cc: Simon Glass <sjg@chromium.org>
>>> Cc: Hua Yanghao <huayanghao@gmail.com>
>>> Cc: Heiko Schocher <hs@denx.de>
>>
>> Looks like the right fix:
>> Acked-by: Linus Walleij <linus.walleij@linaro.org>
>>
>> Yours,
>> Linus Walleij
>
> Acked-by: Simon Glass <sjg@chromium.org>

Applied to u-boot-fdt, thanks!

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

end of thread, other threads:[~2015-07-20 13:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-03 17:29 [U-Boot] [PATCH] cmd_fdt: save fdtaddr in hex format Sudeep Holla
2015-07-03 23:06 ` Simon Glass
2015-07-06  8:47   ` Sudeep Holla
2015-07-10 16:18 ` Sudeep Holla
2015-07-10 23:08   ` Simon Glass
2015-07-16 13:26   ` Linus Walleij
2015-07-16 16:34     ` Simon Glass
2015-07-20 13:25       ` Simon Glass

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.