* [PATCH] bootstd: Fix bootflow info for efi_mgr
@ 2025-10-03 22:27 Sam Protsenko
2025-10-06 20:40 ` Simon Glass
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Sam Protsenko @ 2025-10-03 22:27 UTC (permalink / raw)
To: Simon Glass, Tom Rini
Cc: Mattijs Korpershoek, Heinrich Schuchardt, Jerome Forissier,
u-boot
A "Synchronous Abort" CPU exception happens on an attempt to run the
"bootflow info" command for a global boot method (e.g. efi_mgr):
=> bootflow select 0
=> bootflow info
"Synchronous Abort" handler, esr 0x96000006, far 0x8
It happens because do_bootflow_info() tries to dereference bflow->dev,
which is NULL in case of efi_mgr. Add the corresponding check to prevent
this NULL pointer dereference and make "bootflow info" command work
properly for global boot methods.
Fixes: 2d653f686b6d ("bootstd: Add a bootflow command")
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
---
cmd/bootflow.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmd/bootflow.c b/cmd/bootflow.c
index 551dffbb8b89..081f64e12ce9 100644
--- a/cmd/bootflow.c
+++ b/cmd/bootflow.c
@@ -404,7 +404,7 @@ static int do_bootflow_info(struct cmd_tbl *cmdtp, int flag, int argc,
}
printf("Name: %s\n", bflow->name);
- printf("Device: %s\n", bflow->dev->name);
+ printf("Device: %s\n", bflow->dev ? bflow->dev->name : "(none)");
printf("Block dev: %s\n", bflow->blk ? bflow->blk->name : "(none)");
printf("Method: %s\n", bflow->method->name);
printf("State: %s\n", bootflow_state_get_name(bflow->state));
base-commit: d33b21b7e261691e8d6613a24cc9b0ececba3b01
--
2.39.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] bootstd: Fix bootflow info for efi_mgr
2025-10-03 22:27 [PATCH] bootstd: Fix bootflow info for efi_mgr Sam Protsenko
@ 2025-10-06 20:40 ` Simon Glass
2025-10-07 19:32 ` Sam Protsenko
2025-10-09 11:27 ` Mattijs Korpershoek
2025-10-14 14:20 ` Tom Rini
2 siblings, 1 reply; 7+ messages in thread
From: Simon Glass @ 2025-10-06 20:40 UTC (permalink / raw)
To: Sam Protsenko
Cc: Tom Rini, Mattijs Korpershoek, Heinrich Schuchardt,
Jerome Forissier, u-boot
On Fri, 3 Oct 2025 at 16:27, Sam Protsenko <semen.protsenko@linaro.org> wrote:
>
> A "Synchronous Abort" CPU exception happens on an attempt to run the
> "bootflow info" command for a global boot method (e.g. efi_mgr):
>
> => bootflow select 0
> => bootflow info
>
> "Synchronous Abort" handler, esr 0x96000006, far 0x8
>
> It happens because do_bootflow_info() tries to dereference bflow->dev,
> which is NULL in case of efi_mgr. Add the corresponding check to prevent
> this NULL pointer dereference and make "bootflow info" command work
> properly for global boot methods.
>
> Fixes: 2d653f686b6d ("bootstd: Add a bootflow command")
> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
> ---
> cmd/bootflow.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/cmd/bootflow.c b/cmd/bootflow.c
> index 551dffbb8b89..081f64e12ce9 100644
> --- a/cmd/bootflow.c
> +++ b/cmd/bootflow.c
> @@ -404,7 +404,7 @@ static int do_bootflow_info(struct cmd_tbl *cmdtp, int flag, int argc,
> }
>
> printf("Name: %s\n", bflow->name);
> - printf("Device: %s\n", bflow->dev->name);
> + printf("Device: %s\n", bflow->dev ? bflow->dev->name : "(none)");
> printf("Block dev: %s\n", bflow->blk ? bflow->blk->name : "(none)");
> printf("Method: %s\n", bflow->method->name);
> printf("State: %s\n", bootflow_state_get_name(bflow->state));
>
> base-commit: d33b21b7e261691e8d6613a24cc9b0ececba3b01
> --
> 2.39.5
>
Reviewed-by: Simon Glass <sjg@chromium.org>
If you like, you could an a test for this to bootflow_cmd_info()
Regards,
Simon
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] bootstd: Fix bootflow info for efi_mgr
2025-10-06 20:40 ` Simon Glass
@ 2025-10-07 19:32 ` Sam Protsenko
2025-10-07 19:48 ` Tom Rini
2025-10-08 12:53 ` Simon Glass
0 siblings, 2 replies; 7+ messages in thread
From: Sam Protsenko @ 2025-10-07 19:32 UTC (permalink / raw)
To: Simon Glass
Cc: Tom Rini, Mattijs Korpershoek, Heinrich Schuchardt,
Jerome Forissier, u-boot
Hi Simon,
On Mon, Oct 6, 2025 at 3:40 PM Simon Glass <sjg@chromium.org> wrote:
[snip]
>
> Reviewed-by: Simon Glass <sjg@chromium.org>
>
> If you like, you could an a test for this to bootflow_cmd_info()
>
I remember the last time when I tried running bootstd tests they were
broken. Are they functional now? Also, do we have some short
documentation on running bootstd tests? If so, could you please
reference it. I mean, I can add the test, but unfortunately don't have
enough time to fix the broken test suite (if it's still broken).
> Regards,
> Simon
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] bootstd: Fix bootflow info for efi_mgr
2025-10-07 19:32 ` Sam Protsenko
@ 2025-10-07 19:48 ` Tom Rini
2025-10-08 12:53 ` Simon Glass
1 sibling, 0 replies; 7+ messages in thread
From: Tom Rini @ 2025-10-07 19:48 UTC (permalink / raw)
To: Sam Protsenko
Cc: Simon Glass, Mattijs Korpershoek, Heinrich Schuchardt,
Jerome Forissier, u-boot
[-- Attachment #1: Type: text/plain, Size: 857 bytes --]
On Tue, Oct 07, 2025 at 02:32:15PM -0500, Sam Protsenko wrote:
> Hi Simon,
>
> On Mon, Oct 6, 2025 at 3:40 PM Simon Glass <sjg@chromium.org> wrote:
>
> [snip]
>
> >
> > Reviewed-by: Simon Glass <sjg@chromium.org>
> >
> > If you like, you could an a test for this to bootflow_cmd_info()
> >
>
> I remember the last time when I tried running bootstd tests they were
> broken. Are they functional now? Also, do we have some short
> documentation on running bootstd tests? If so, could you please
> reference it. I mean, I can add the test, but unfortunately don't have
> enough time to fix the broken test suite (if it's still broken).
I think any future regressions in this area are things that smatch would
catch and we'll get that in CI soon enough. Coverity (and smatch) may or
may not have also caught this, FWIW.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] bootstd: Fix bootflow info for efi_mgr
2025-10-07 19:32 ` Sam Protsenko
2025-10-07 19:48 ` Tom Rini
@ 2025-10-08 12:53 ` Simon Glass
1 sibling, 0 replies; 7+ messages in thread
From: Simon Glass @ 2025-10-08 12:53 UTC (permalink / raw)
To: Sam Protsenko
Cc: Tom Rini, Mattijs Korpershoek, Heinrich Schuchardt,
Jerome Forissier, u-boot
Hi Sam,
On Tue, 7 Oct 2025 at 13:32, Sam Protsenko <semen.protsenko@linaro.org> wrote:
>
> Hi Simon,
>
> On Mon, Oct 6, 2025 at 3:40 PM Simon Glass <sjg@chromium.org> wrote:
>
> [snip]
>
> >
> > Reviewed-by: Simon Glass <sjg@chromium.org>
> >
> > If you like, you could an a test for this to bootflow_cmd_info()
> >
>
> I remember the last time when I tried running bootstd tests they were
> broken. Are they functional now? Also, do we have some short
> documentation on running bootstd tests? If so, could you please
> reference it. I mean, I can add the test, but unfortunately don't have
> enough time to fix the broken test suite (if it's still broken).
It runs in CI so I don't think it can be broken. But perhaps it
doesn't work locally for you?
You need to run test.py first (e.g. with -k bootstd) to get it to
create the test files. After that you can just run sandbox with 'ut
bootstd ...' which is a bit quicker.
There is quite a bit of documentation too at [1]
Regards,
Simon
[1] https://docs.u-boot.org/en/latest/develop/testing.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] bootstd: Fix bootflow info for efi_mgr
2025-10-03 22:27 [PATCH] bootstd: Fix bootflow info for efi_mgr Sam Protsenko
2025-10-06 20:40 ` Simon Glass
@ 2025-10-09 11:27 ` Mattijs Korpershoek
2025-10-14 14:20 ` Tom Rini
2 siblings, 0 replies; 7+ messages in thread
From: Mattijs Korpershoek @ 2025-10-09 11:27 UTC (permalink / raw)
To: Sam Protsenko, Simon Glass, Tom Rini
Cc: Mattijs Korpershoek, Heinrich Schuchardt, Jerome Forissier,
u-boot
Hi Sam,
Thank you for the patch.
On Fri, Oct 03, 2025 at 17:27, Sam Protsenko <semen.protsenko@linaro.org> wrote:
> A "Synchronous Abort" CPU exception happens on an attempt to run the
> "bootflow info" command for a global boot method (e.g. efi_mgr):
>
> => bootflow select 0
> => bootflow info
>
> "Synchronous Abort" handler, esr 0x96000006, far 0x8
>
> It happens because do_bootflow_info() tries to dereference bflow->dev,
> which is NULL in case of efi_mgr. Add the corresponding check to prevent
> this NULL pointer dereference and make "bootflow info" command work
> properly for global boot methods.
>
> Fixes: 2d653f686b6d ("bootstd: Add a bootflow command")
> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
> ---
> cmd/bootflow.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/cmd/bootflow.c b/cmd/bootflow.c
> index 551dffbb8b89..081f64e12ce9 100644
> --- a/cmd/bootflow.c
> +++ b/cmd/bootflow.c
> @@ -404,7 +404,7 @@ static int do_bootflow_info(struct cmd_tbl *cmdtp, int flag, int argc,
> }
>
> printf("Name: %s\n", bflow->name);
> - printf("Device: %s\n", bflow->dev->name);
> + printf("Device: %s\n", bflow->dev ? bflow->dev->name : "(none)");
> printf("Block dev: %s\n", bflow->blk ? bflow->blk->name : "(none)");
> printf("Method: %s\n", bflow->method->name);
> printf("State: %s\n", bootflow_state_get_name(bflow->state));
>
> base-commit: d33b21b7e261691e8d6613a24cc9b0ececba3b01
> --
> 2.39.5
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] bootstd: Fix bootflow info for efi_mgr
2025-10-03 22:27 [PATCH] bootstd: Fix bootflow info for efi_mgr Sam Protsenko
2025-10-06 20:40 ` Simon Glass
2025-10-09 11:27 ` Mattijs Korpershoek
@ 2025-10-14 14:20 ` Tom Rini
2 siblings, 0 replies; 7+ messages in thread
From: Tom Rini @ 2025-10-14 14:20 UTC (permalink / raw)
To: Simon Glass, Sam Protsenko
Cc: Mattijs Korpershoek, Heinrich Schuchardt, Jerome Forissier,
u-boot
On Fri, 03 Oct 2025 17:27:14 -0500, Sam Protsenko wrote:
> A "Synchronous Abort" CPU exception happens on an attempt to run the
> "bootflow info" command for a global boot method (e.g. efi_mgr):
>
> => bootflow select 0
> => bootflow info
>
> "Synchronous Abort" handler, esr 0x96000006, far 0x8
>
> [...]
Applied to u-boot/master, thanks!
[1/1] bootstd: Fix bootflow info for efi_mgr
commit: 3b278dd9e6643a9f75ef108d229c619e197067d0
--
Tom
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-10-14 14:21 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-03 22:27 [PATCH] bootstd: Fix bootflow info for efi_mgr Sam Protsenko
2025-10-06 20:40 ` Simon Glass
2025-10-07 19:32 ` Sam Protsenko
2025-10-07 19:48 ` Tom Rini
2025-10-08 12:53 ` Simon Glass
2025-10-09 11:27 ` Mattijs Korpershoek
2025-10-14 14:20 ` Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox