From: Mattijs Korpershoek via U-Boot <u-boot@lists.u-boot-project.org>
To: Alexey Charkov <alchark@flipper.net>,
Mattijs Korpershoek <mkorpershoek@kernel.org>,
Safae Ouajih <souajih@baylibre.com>,
Simon Glass <sjg@chromium.org>,
u-boot@lists.denx.de
Cc: Tom Rini <trini@konsulko.com>,
"Guillaume La Roque (TI.com)" <glaroque@baylibre.com>,
Guillaume Ranquet <ranquet.guillaume@gmail.com>,
Marek Vasut <marek.vasut+renesas@mailbox.org>,
Alexey Charkov <alchark@flipper.net>
Subject: Re: [PATCH] boot: android: fix out-of-bounds access in bootconfig parsing
Date: Tue, 21 Jul 2026 17:04:09 +0200 [thread overview]
Message-ID: <87se5cidue.fsf@kernel.org> (raw)
In-Reply-To: <20260708-image-android-oob-fix-v1-1-a96de8ccd25e@flipper.net>
Hi Alexey,
Thank you for the patch.
On Wed, Jul 08, 2026 at 21:32, Alexey Charkov <alchark@flipper.net> wrote:
> When android_image_get_vendor_bootimg_size is called, its buffer is only
> allocated with enough space for the bootconfig header, but the
> android_vendor_boot_image_v3_v4_parse_hdr helper attempts to append a
> bootconfig trailer to it, causing an out-of-bounds access and heap
> corruption in some cases (e.g. triggered in sandbox test builds when
> extra bootmeths are added, resulting in a segfault of the sandbox
> process).
>
> Skip the dangerous memcpy operations altogether when the
> android_vendor_boot_image_v3_v4_parse_hdr helper is only called for size
> calculation purposes, and only append the bootconfig trailer when called
> from the actual bootconfig parsing code path.
>
> Fixes: 57e405e1f474 ("android: boot: support bootconfig")
> Signed-off-by: Alexey Charkov <alchark@flipper.net>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
> ---
next prev parent reply other threads:[~2026-07-21 15:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-08 17:32 [PATCH] boot: android: fix out-of-bounds access in bootconfig parsing Alexey Charkov
2026-07-17 13:54 ` Simon Glass
2026-07-21 15:04 ` Mattijs Korpershoek via U-Boot [this message]
2026-07-22 6:54 ` Mattijs Korpershoek via U-Boot
2026-07-22 7:07 ` Mattijs Korpershoek via U-Boot
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=87se5cidue.fsf@kernel.org \
--to=u-boot@lists.u-boot-project.org \
--cc=alchark@flipper.net \
--cc=glaroque@baylibre.com \
--cc=marek.vasut+renesas@mailbox.org \
--cc=mkorpershoek@kernel.org \
--cc=ranquet.guillaume@gmail.com \
--cc=sjg@chromium.org \
--cc=souajih@baylibre.com \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/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