* [PATCH] cmd: pxe_utils: sysboot: fix crash if either board or soc are not set.
@ 2021-04-21 11:42 Dimitri John Ledkov
2021-05-04 10:25 ` Dimitri John Ledkov
2021-05-08 6:23 ` Ramon Fried
0 siblings, 2 replies; 5+ messages in thread
From: Dimitri John Ledkov @ 2021-04-21 11:42 UTC (permalink / raw)
To: u-boot
If the environment does not have "soc" or "board" set, and fdtdir
option is specified in extlinux.conf, the bootloader will crash whilst
dereferencing a null pointer. Add a guard against null soc or
board. Fixes a crash of qemu-riscv64_smode configuration, which does
not have CONFIG_SYS_SOC defined.
Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
---
cmd/pxe_utils.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/cmd/pxe_utils.c b/cmd/pxe_utils.c
index 71c5af4c25..9a30629e26 100644
--- a/cmd/pxe_utils.c
+++ b/cmd/pxe_utils.c
@@ -587,6 +587,14 @@ static int label_boot(struct cmd_tbl *cmdtp, struct pxe_label *label)
f2 = "-";
f3 = env_get("board");
f4 = ".dtb";
+ if (!f1) {
+ f1 = "";
+ f2 = "";
+ }
+ if (!f3) {
+ f2 = "";
+ f3 = "";
+ }
}
len = strlen(label->fdtdir);
--
2.27.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] cmd: pxe_utils: sysboot: fix crash if either board or soc are not set.
2021-04-21 11:42 [PATCH] cmd: pxe_utils: sysboot: fix crash if either board or soc are not set Dimitri John Ledkov
@ 2021-05-04 10:25 ` Dimitri John Ledkov
2021-05-08 6:23 ` Ramon Fried
1 sibling, 0 replies; 5+ messages in thread
From: Dimitri John Ledkov @ 2021-05-04 10:25 UTC (permalink / raw)
To: u-boot
Hi qemu-board meaintainers,
The below patch affects any boards that do not have either board or
soc variables set.
Of which non-x86 qemu boards are exactly that, preventing to netboot
the same rootfs across multiple boards and qemu at the same time.
Another alternative would be for all non-x86 qemu boards to also define
config SYS_SOC
default "qemu"
However, I fear similar situation might still arise in the future
where some boards lack either SYS_BOARD or SYS_SOC definitions. Thus
even if non-qemu boards are fixed up, the below should still be
applied?
Do you want me to send a separate patch to add SYS_SOC to all qemu boards?
On Wed, Apr 21, 2021 at 3:32 PM Dimitri John Ledkov <xnox@ubuntu.com> wrote:
>
> If the environment does not have "soc" or "board" set, and fdtdir
> option is specified in extlinux.conf, the bootloader will crash whilst
> dereferencing a null pointer. Add a guard against null soc or
> board. Fixes a crash of qemu-riscv64_smode configuration, which does
> not have CONFIG_SYS_SOC defined.
>
> Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
> ---
> cmd/pxe_utils.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/cmd/pxe_utils.c b/cmd/pxe_utils.c
> index 71c5af4c25..9a30629e26 100644
> --- a/cmd/pxe_utils.c
> +++ b/cmd/pxe_utils.c
> @@ -587,6 +587,14 @@ static int label_boot(struct cmd_tbl *cmdtp, struct pxe_label *label)
> f2 = "-";
> f3 = env_get("board");
> f4 = ".dtb";
> + if (!f1) {
> + f1 = "";
> + f2 = "";
> + }
> + if (!f3) {
> + f2 = "";
> + f3 = "";
> + }
> }
>
> len = strlen(label->fdtdir);
> --
> 2.27.0
>
--
Regards,
Dimitri.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] cmd: pxe_utils: sysboot: fix crash if either board or soc are not set.
2021-04-21 11:42 [PATCH] cmd: pxe_utils: sysboot: fix crash if either board or soc are not set Dimitri John Ledkov
2021-05-04 10:25 ` Dimitri John Ledkov
@ 2021-05-08 6:23 ` Ramon Fried
2021-06-15 16:14 ` Dimitri John Ledkov
1 sibling, 1 reply; 5+ messages in thread
From: Ramon Fried @ 2021-05-08 6:23 UTC (permalink / raw)
To: u-boot
On Wed, Apr 21, 2021 at 5:32 PM Dimitri John Ledkov <xnox@ubuntu.com> wrote:
>
> If the environment does not have "soc" or "board" set, and fdtdir
> option is specified in extlinux.conf, the bootloader will crash whilst
> dereferencing a null pointer. Add a guard against null soc or
> board. Fixes a crash of qemu-riscv64_smode configuration, which does
> not have CONFIG_SYS_SOC defined.
>
> Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
> ---
> cmd/pxe_utils.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/cmd/pxe_utils.c b/cmd/pxe_utils.c
> index 71c5af4c25..9a30629e26 100644
> --- a/cmd/pxe_utils.c
> +++ b/cmd/pxe_utils.c
> @@ -587,6 +587,14 @@ static int label_boot(struct cmd_tbl *cmdtp, struct pxe_label *label)
> f2 = "-";
> f3 = env_get("board");
> f4 = ".dtb";
> + if (!f1) {
> + f1 = "";
> + f2 = "";
> + }
> + if (!f3) {
> + f2 = "";
> + f3 = "";
> + }
> }
>
> len = strlen(label->fdtdir);
> --
> 2.27.0
>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] cmd: pxe_utils: sysboot: fix crash if either board or soc are not set.
2021-05-08 6:23 ` Ramon Fried
@ 2021-06-15 16:14 ` Dimitri John Ledkov
2021-06-18 8:25 ` Ramon Fried
0 siblings, 1 reply; 5+ messages in thread
From: Dimitri John Ledkov @ 2021-06-15 16:14 UTC (permalink / raw)
To: Ramon Fried; +Cc: U-Boot Mailing List
Hi, this patch is still not pulled into master. It still applies
cleanly onto master.
Can this patch please be pulled in? It fixes a crash of uboot.
Without this patch upstream, people who build their own uboot cannot
boot stock Ubuntu images.
What can I do, for this patch to be applied?
On Sat, May 8, 2021 at 7:23 AM Ramon Fried <rfried.dev@gmail.com> wrote:
>
> On Wed, Apr 21, 2021 at 5:32 PM Dimitri John Ledkov <xnox@ubuntu.com> wrote:
> >
> > If the environment does not have "soc" or "board" set, and fdtdir
> > option is specified in extlinux.conf, the bootloader will crash whilst
> > dereferencing a null pointer. Add a guard against null soc or
> > board. Fixes a crash of qemu-riscv64_smode configuration, which does
> > not have CONFIG_SYS_SOC defined.
> >
> > Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
> > ---
> > cmd/pxe_utils.c | 8 ++++++++
> > 1 file changed, 8 insertions(+)
> >
> > diff --git a/cmd/pxe_utils.c b/cmd/pxe_utils.c
> > index 71c5af4c25..9a30629e26 100644
> > --- a/cmd/pxe_utils.c
> > +++ b/cmd/pxe_utils.c
> > @@ -587,6 +587,14 @@ static int label_boot(struct cmd_tbl *cmdtp, struct pxe_label *label)
> > f2 = "-";
> > f3 = env_get("board");
> > f4 = ".dtb";
> > + if (!f1) {
> > + f1 = "";
> > + f2 = "";
> > + }
> > + if (!f3) {
> > + f2 = "";
> > + f3 = "";
> > + }
> > }
> >
> > len = strlen(label->fdtdir);
> > --
> > 2.27.0
> >
> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
--
Regards,
Dimitri.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] cmd: pxe_utils: sysboot: fix crash if either board or soc are not set.
2021-06-15 16:14 ` Dimitri John Ledkov
@ 2021-06-18 8:25 ` Ramon Fried
0 siblings, 0 replies; 5+ messages in thread
From: Ramon Fried @ 2021-06-18 8:25 UTC (permalink / raw)
To: Dimitri John Ledkov; +Cc: U-Boot Mailing List
On Tue, Jun 15, 2021 at 7:15 PM Dimitri John Ledkov
<dimitri.ledkov@canonical.com> wrote:
>
> Hi, this patch is still not pulled into master. It still applies
> cleanly onto master.
>
> Can this patch please be pulled in? It fixes a crash of uboot.
> Without this patch upstream, people who build their own uboot cannot
> boot stock Ubuntu images.
>
> What can I do, for this patch to be applied?
>
> On Sat, May 8, 2021 at 7:23 AM Ramon Fried <rfried.dev@gmail.com> wrote:
> >
> > On Wed, Apr 21, 2021 at 5:32 PM Dimitri John Ledkov <xnox@ubuntu.com> wrote:
> > >
> > > If the environment does not have "soc" or "board" set, and fdtdir
> > > option is specified in extlinux.conf, the bootloader will crash whilst
> > > dereferencing a null pointer. Add a guard against null soc or
> > > board. Fixes a crash of qemu-riscv64_smode configuration, which does
> > > not have CONFIG_SYS_SOC defined.
> > >
> > > Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
> > > ---
> > > cmd/pxe_utils.c | 8 ++++++++
> > > 1 file changed, 8 insertions(+)
> > >
> > > diff --git a/cmd/pxe_utils.c b/cmd/pxe_utils.c
> > > index 71c5af4c25..9a30629e26 100644
> > > --- a/cmd/pxe_utils.c
> > > +++ b/cmd/pxe_utils.c
> > > @@ -587,6 +587,14 @@ static int label_boot(struct cmd_tbl *cmdtp, struct pxe_label *label)
> > > f2 = "-";
> > > f3 = env_get("board");
> > > f4 = ".dtb";
> > > + if (!f1) {
> > > + f1 = "";
> > > + f2 = "";
> > > + }
> > > + if (!f3) {
> > > + f2 = "";
> > > + f3 = "";
> > > + }
> > > }
> > >
> > > len = strlen(label->fdtdir);
> > > --
> > > 2.27.0
> > >
> > Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
>
>
>
> --
> Regards,
>
> Dimitri.
applied to u-boot-net/master, thanks!
Best regards,
Ramon Fried
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-06-18 8:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-21 11:42 [PATCH] cmd: pxe_utils: sysboot: fix crash if either board or soc are not set Dimitri John Ledkov
2021-05-04 10:25 ` Dimitri John Ledkov
2021-05-08 6:23 ` Ramon Fried
2021-06-15 16:14 ` Dimitri John Ledkov
2021-06-18 8:25 ` Ramon Fried
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.