android: boot: fix wrong end of header in v3/v4 parsing
authorGuillaume Ranquet <ranquet.guillaume@gmail.com>
Thu, 11 Sep 2025 13:50:26 +0000 (15:50 +0200)
committerTom Rini <trini@konsulko.com>
Wed, 24 Sep 2025 17:03:16 +0000 (11:03 -0600)
commit5289b6e5540e571afd81482305e5623e9124ea66
treeaeaa0a99203c86f45ff98cd4d4f518e2d3fdbc0d
parent1e8592e0ec4aa01c52b5be22bf5080973eccddba
android: boot: fix wrong end of header in v3/v4 parsing

The android boot header is page aligned but the current code made the
assumption that the header was always smaller than the current header
format.

When the page_size is defined as 2048, as this is the case with the
cuttlefish target, the current code sets the end of the header in the
middle of it as the v3 and v4 headers are respectively 2112 and 2128
bytes long.

Fix that by aligning to page_size

Fixes: 1115027d2f75 ("android: boot: update android_image_get_data to support v3, v4")
Signed-off-by: Guillaume Ranquet <ranquet.guillaume@gmail.com>
boot/image-android.c
include/android_image.h