From: Yao Zi <me@ziyao.cc>
To: Sebastian Alba Vives <sebasjosue84@gmail.com>,
u-boot@lists.u-boot-project.org
Cc: trini@konsulko.com, sjg@chromium.org, michal.simek@amd.com,
Yao Zi <me@ziyao.cc>
Subject: Re: [PATCH v2 2/2] spl: opensbi: Check the return of the entry/load lookup
Date: Tue, 13 Oct 2026 20:17:29 +0000 [thread overview]
Message-ID: <as6R2YFyXUlGPq4j@pie> (raw)
In-Reply-To: <20261012214604.1477684-3-sebasjosue84@gmail.com>
On Mon, Oct 12, 2026 at 03:46:04PM -0600, Sebastian Alba Vives wrote:
> spl_invoke_opensbi() takes the next-stage entry point from a
> /fit-images node with fit_image_get_entry(), falling back to
> fit_image_get_load(). fit_image_get_address() returns -1 without
> assigning the caller's ulong, both when the property is absent and
> when the address does not fit in a target ulong, so os_entry stays
> uninitialised when a node has neither property.
>
> ret was not tested after the fallback, so that uninitialised stack
> value became opensbi_info.next_addr, the address OpenSBI jumps to when
> it hands control to S-mode.
>
> spl_opensbi_find_os_node() selects the first /fit-images subnode whose
> os property matches the requested type and does not require an entry
> or load property, so such a node is reachable.
>
> Fail the boot instead, matching how the rest of the function handles a
> device tree it cannot use.
>
> Fixes: caa7fc2c5775 ("spl: Use standard FIT entries")
> Signed-off-by: Sebastian Alba Vives <sebasjosue84@gmail.com>
Reviewed-by: Yao Zi <me@ziyao.cc>
> ---
> common/spl/spl_opensbi.c | 5 +++++
> 1 file changed, 5 insertions(+)
Thanks,
Yao Zi
prev parent reply other threads:[~2026-10-13 20:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-12 21:46 [PATCH v2 0/2] spl: Fix the uninitialised /fit-images entry point Sebastian Alba Vives
2026-10-12 21:46 ` [PATCH v2 1/2] spl: atf: Keep the caller's default when the entry lookup fails Sebastian Alba Vives
2026-10-12 21:46 ` [PATCH v2 2/2] spl: opensbi: Check the return of the entry/load lookup Sebastian Alba Vives
2026-10-13 20:17 ` Yao Zi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=as6R2YFyXUlGPq4j@pie \
--to=me@ziyao.cc \
--cc=michal.simek@amd.com \
--cc=sebasjosue84@gmail.com \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.u-boot-project.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox