* [u-boot,v2019.04-aspeed, v1 0/1] Common:fdt: Check for error return
@ 2020-12-02 19:47 Hongwei Zhang
2020-12-02 19:47 ` [u-boot, v2019.04-aspeed, v1 1/1] Common:fdt: Check for error return value Hongwei Zhang
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Hongwei Zhang @ 2020-12-02 19:47 UTC (permalink / raw)
To: u-boot
Hello Reviewer,
Check for negative return value of fdt_noffset from calling
boot_get_fdt_fit(). Otherwise, when fdt subimage is corrupted, the
u-boot report bad hash value but continue loading kernel image and
get hanged later.
Hongwei Zhang (1):
Common:fdt: Check for error return value
common/image-fdt.c | 3 +++
1 file changed, 3 insertions(+)
--
2.17.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [u-boot, v2019.04-aspeed, v1 1/1] Common:fdt: Check for error return value
2020-12-02 19:47 [u-boot,v2019.04-aspeed, v1 0/1] Common:fdt: Check for error return Hongwei Zhang
@ 2020-12-02 19:47 ` Hongwei Zhang
2020-12-12 15:35 ` [u-boot,v2019.04-aspeed, " Simon Glass
2020-12-03 2:17 ` [u-boot, v2019.04-aspeed, v1 0/1] Common:fdt: Check for error return Joel Stanley
2020-12-03 19:09 ` [u-boot,v2019.04-aspeed, " Hongwei Zhang
2 siblings, 1 reply; 7+ messages in thread
From: Hongwei Zhang @ 2020-12-02 19:47 UTC (permalink / raw)
To: u-boot
Check for negative return value of fdt_noffset from calling
boot_get_fdt_fit().
Signed-off-by: Hongwei Zhang <hongweiz@ami.com>
---
common/image-fdt.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/common/image-fdt.c b/common/image-fdt.c
index 01186aeac7..52ada56fc1 100644
--- a/common/image-fdt.c
+++ b/common/image-fdt.c
@@ -402,6 +402,9 @@ int boot_get_fdt(int flag, int argc, char * const argv[], uint8_t arch,
&fit_uname_config,
arch, &load, &len);
+ if (fdt_noffset < 0)
+ goto error;
+
images->fit_hdr_fdt = map_sysmem(fdt_addr, 0);
images->fit_uname_fdt = fit_uname_fdt;
images->fit_noffset_fdt = fdt_noffset;
--
2.17.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [u-boot, v2019.04-aspeed, v1 0/1] Common:fdt: Check for error return
2020-12-02 19:47 [u-boot,v2019.04-aspeed, v1 0/1] Common:fdt: Check for error return Hongwei Zhang
2020-12-02 19:47 ` [u-boot, v2019.04-aspeed, v1 1/1] Common:fdt: Check for error return value Hongwei Zhang
@ 2020-12-03 2:17 ` Joel Stanley
2020-12-03 19:09 ` [u-boot,v2019.04-aspeed, " Hongwei Zhang
2 siblings, 0 replies; 7+ messages in thread
From: Joel Stanley @ 2020-12-03 2:17 UTC (permalink / raw)
To: u-boot
Hello Hongwei,
On Wed, 2 Dec 2020 at 19:48, Hongwei Zhang <hongweiz@ami.com> wrote:
>
> Hello Reviewer,
>
> Check for negative return value of fdt_noffset from calling
> boot_get_fdt_fit(). Otherwise, when fdt subimage is corrupted, the
> u-boot report bad hash value but continue loading kernel image and
> get hanged later.
I can see from your subject line that you intended this to go to
Aspeed's fork of u-boot. That's fine, but you shouldn't cc the
upstream maintainers as they don't care for these changes.
If the bug exists in mainline u-boot, you should certainly send the
fix there and ask for it to be backported to the aspeed fork.
Cheers,
Joel
>
> Hongwei Zhang (1):
> Common:fdt: Check for error return value
>
> common/image-fdt.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [u-boot,v2019.04-aspeed, v1 0/1] Common:fdt: Check for error return
2020-12-02 19:47 [u-boot,v2019.04-aspeed, v1 0/1] Common:fdt: Check for error return Hongwei Zhang
2020-12-02 19:47 ` [u-boot, v2019.04-aspeed, v1 1/1] Common:fdt: Check for error return value Hongwei Zhang
2020-12-03 2:17 ` [u-boot, v2019.04-aspeed, v1 0/1] Common:fdt: Check for error return Joel Stanley
@ 2020-12-03 19:09 ` Hongwei Zhang
2020-12-08 3:11 ` [u-boot, v2019.04-aspeed, " Joel Stanley
2 siblings, 1 reply; 7+ messages in thread
From: Hongwei Zhang @ 2020-12-03 19:09 UTC (permalink / raw)
To: u-boot
Thanks Joel,
> From: Joel Stanley <joel@jms.id.au>
> Sent: Wednesday, December 2, 2020 9:17 PM
> To: Hongwei Zhang
>
> Hello Hongwei,
>
> On Wed, 2 Dec 2020 at 19:48, Hongwei Zhang <hongweiz@ami.com> wrote:
> >
> > Hello Reviewer,
> >
> > Check for negative return value of fdt_noffset from calling
> > boot_get_fdt_fit(). Otherwise, when fdt subimage is corrupted, the
> > u-boot report bad hash value but continue loading kernel image and
> > get hanged later.
>
> I can see from your subject line that you intended this to go to
> Aspeed's fork of u-boot. That's fine, but you shouldn't cc the
> upstream maintainers as they don't care for these changes.
>
> If the bug exists in mainline u-boot, you should certainly send the
> fix there and ask for it to be backported to the aspeed fork.
I think this issue existing in mainline u-boot, however, I have difficulty
to include 'master' branch of u-boot in openbmc project, to acturaly test
it. There are compiling errors.
Also, I'm not sure for mainline u-boot, which branch should I use to test
and verification? is it 'master', or 'next' branch?
--Hongwei
>
> Cheers,
>
> Joel
>
> >
> > Hongwei Zhang (1):
> > Common:fdt: Check for error return value
> >
> > common/image-fdt.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > --
> > 2.17.1
> >
^ permalink raw reply [flat|nested] 7+ messages in thread
* [u-boot, v2019.04-aspeed, v1 0/1] Common:fdt: Check for error return
2020-12-03 19:09 ` [u-boot,v2019.04-aspeed, " Hongwei Zhang
@ 2020-12-08 3:11 ` Joel Stanley
0 siblings, 0 replies; 7+ messages in thread
From: Joel Stanley @ 2020-12-08 3:11 UTC (permalink / raw)
To: u-boot
On Thu, 3 Dec 2020 at 19:11, Hongwei Zhang <hongweiz@ami.com> wrote:
>
> Thanks Joel,
>
> > From: Joel Stanley <joel@jms.id.au>
> > Sent: Wednesday, December 2, 2020 9:17 PM
> > To: Hongwei Zhang
> >
> > Hello Hongwei,
> >
> > On Wed, 2 Dec 2020 at 19:48, Hongwei Zhang <hongweiz@ami.com> wrote:
> > >
> > > Hello Reviewer,
> > >
> > > Check for negative return value of fdt_noffset from calling
> > > boot_get_fdt_fit(). Otherwise, when fdt subimage is corrupted, the
> > > u-boot report bad hash value but continue loading kernel image and
> > > get hanged later.
> >
> > I can see from your subject line that you intended this to go to
> > Aspeed's fork of u-boot. That's fine, but you shouldn't cc the
> > upstream maintainers as they don't care for these changes.
> >
> > If the bug exists in mainline u-boot, you should certainly send the
> > fix there and ask for it to be backported to the aspeed fork.
>
> I think this issue existing in mainline u-boot, however, I have difficulty
> to include 'master' branch of u-boot in openbmc project, to acturaly test
> it. There are compiling errors.
>
> Also, I'm not sure for mainline u-boot, which branch should I use to test
> and verification? is it 'master', or 'next' branch?
I suspect it doesn't matter much. As this is a small fix, I would
chose to send it to master. (I see that's what you did)
>
> --Hongwei
> >
> > Cheers,
> >
> > Joel
> >
> > >
> > > Hongwei Zhang (1):
> > > Common:fdt: Check for error return value
> > >
> > > common/image-fdt.c | 3 +++
> > > 1 file changed, 3 insertions(+)
> > >
> > > --
> > > 2.17.1
> > >
^ permalink raw reply [flat|nested] 7+ messages in thread
* [u-boot,v2019.04-aspeed, v1 1/1] Common:fdt: Check for error return value
2020-12-02 19:47 ` [u-boot, v2019.04-aspeed, v1 1/1] Common:fdt: Check for error return value Hongwei Zhang
@ 2020-12-12 15:35 ` Simon Glass
2020-12-23 15:45 ` Simon Glass
0 siblings, 1 reply; 7+ messages in thread
From: Simon Glass @ 2020-12-12 15:35 UTC (permalink / raw)
To: u-boot
On Wed, 2 Dec 2020 at 12:48, Hongwei Zhang <hongweiz@ami.com> wrote:
>
> Check for negative return value of fdt_noffset from calling
> boot_get_fdt_fit().
>
> Signed-off-by: Hongwei Zhang <hongweiz@ami.com>
> ---
> common/image-fdt.c | 3 +++
> 1 file changed, 3 insertions(+)
>
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [u-boot,v2019.04-aspeed, v1 1/1] Common:fdt: Check for error return value
2020-12-12 15:35 ` [u-boot,v2019.04-aspeed, " Simon Glass
@ 2020-12-23 15:45 ` Simon Glass
0 siblings, 0 replies; 7+ messages in thread
From: Simon Glass @ 2020-12-23 15:45 UTC (permalink / raw)
To: u-boot
On Sat, 12 Dec 2020 at 08:35, Simon Glass <sjg@chromium.org> wrote:
>
> On Wed, 2 Dec 2020 at 12:48, Hongwei Zhang <hongweiz@ami.com> wrote:
> >
> > Check for negative return value of fdt_noffset from calling
> > boot_get_fdt_fit().
> >
> > Signed-off-by: Hongwei Zhang <hongweiz@ami.com>
> > ---
> > common/image-fdt.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
>
> Reviewed-by: Simon Glass <sjg@chromium.org>
Applied to u-boot-dm/next, thanks!
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-12-23 15:45 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-02 19:47 [u-boot,v2019.04-aspeed, v1 0/1] Common:fdt: Check for error return Hongwei Zhang
2020-12-02 19:47 ` [u-boot, v2019.04-aspeed, v1 1/1] Common:fdt: Check for error return value Hongwei Zhang
2020-12-12 15:35 ` [u-boot,v2019.04-aspeed, " Simon Glass
2020-12-23 15:45 ` Simon Glass
2020-12-03 2:17 ` [u-boot, v2019.04-aspeed, v1 0/1] Common:fdt: Check for error return Joel Stanley
2020-12-03 19:09 ` [u-boot,v2019.04-aspeed, " Hongwei Zhang
2020-12-08 3:11 ` [u-boot, v2019.04-aspeed, " Joel Stanley
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.