public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Julien Masson <jmasson@baylibre.com>
To: Mattijs Korpershoek <mkorpershoek@baylibre.com>,
	Simon Glass <sjg@chromium.org>, Tom Rini <trini@konsulko.com>,
	Guillaume La Roque <glaroque@baylibre.com>
Cc: <u-boot@lists.denx.de>, Mattijs Korpershoek <mkorpershoek@baylibre.com>
Subject: Re: [PATCH v2 1/2] bootstd: android: Add missing NULL in the avb partition list
Date: Thu, 23 Jan 2025 14:39:10 +0100	[thread overview]
Message-ID: <874j1pd4zl.fsf@baylibre.com> (raw)
In-Reply-To: <20250108-avb-disable-verif-v2-1-ba7d3b0d5b6a@baylibre.com>


On Thu 23 Jan 2025 at 14:38, Mattijs Korpershoek <mkorpershoek@baylibre.com> wrote:

> When booting an Android build with AVB enabled, it's still possible to
> deactivate the check for development purposes if the bootloader state is
> UNLOCKED.
> 
> This is very useful for development and can be done at flashing time via:
> $ fastboot flash --disable-verity --disable-verification vbmeta vbmeta.img
> 
> However, with bootmeth_android, we cannot boot this way:
> 
>     Scanning bootdev 'mmc@fa10000.bootdev':
>       0  android      ready   mmc          0  mmc@fa10000.bootdev.whole
>     ** Booting bootflow 'mmc@fa10000.bootdev.whole' with android
>     avb_vbmeta_image.c:188: ERROR: Hash does not match!
>     avb_slot_verify.c:732: ERROR: vbmeta_a: Error verifying vbmeta image: HASH_MISMATCH
>     get_partition: can't find partition '_a'
>     avb_slot_verify.c:496: ERROR: _a: Error determining partition size.
>     Verification failed, reason: I/O error occurred while trying to load data
>     Boot failed (err=-5)
>     No more bootdevs
> 
> From the logs we can see that avb tries to read a partition named '_a'.
> It's doing so because the last element of requested_partitions implicitly is
> '\0', but the doc explicitly request it to be NULL instead.
> 
> Add NULL as last element to requested_partitions to avoid this problem.
> 
> Fixes: 125d9f3306ea ("bootstd: Add a bootmeth for Android")
> Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
> ---
>  boot/bootmeth_android.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/boot/bootmeth_android.c b/boot/bootmeth_android.c
> index 19b1f2c377b9a51ff1683259085e1d636c939413..2cd167f80280801618a317a65e93a10e70a0d9ee 100644
> --- a/boot/bootmeth_android.c
> +++ b/boot/bootmeth_android.c
> @@ -380,7 +380,7 @@ static int run_avb_verification(struct bootflow *bflow)
>  {
>  	struct blk_desc *desc = dev_get_uclass_plat(bflow->blk);
>  	struct android_priv *priv = bflow->bootmeth_priv;
> -	const char * const requested_partitions[] = {"boot", "vendor_boot"};
> +	const char * const requested_partitions[] = {"boot", "vendor_boot", NULL};
>  	struct AvbOps *avb_ops;
>  	AvbSlotVerifyResult result;
>  	AvbSlotVerifyData *out_data;
> 
> -- 
> 2.47.1
> 

Reviewed-by: Julien Masson <jmasson@baylibre.com>

  reply	other threads:[~2025-01-23 13:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-08 14:38 [PATCH v2 0/2] bootstd: android: Allow booting with AVB failures when unlocked Mattijs Korpershoek
2025-01-08 14:38 ` [PATCH v2 1/2] bootstd: android: Add missing NULL in the avb partition list Mattijs Korpershoek
2025-01-23 13:39   ` Julien Masson [this message]
2025-01-08 14:38 ` [PATCH v2 2/2] bootstd: android: Allow boot with AVB failures when unlocked Mattijs Korpershoek
2025-01-23 13:40   ` Julien Masson
2025-01-23 14:23 ` [PATCH v2 0/2] bootstd: android: Allow booting " Mattijs Korpershoek

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=874j1pd4zl.fsf@baylibre.com \
    --to=jmasson@baylibre.com \
    --cc=glaroque@baylibre.com \
    --cc=mkorpershoek@baylibre.com \
    --cc=sjg@chromium.org \
    --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