From: Matthew Daley Date: Tue, 6 Nov 2018 22:44:08 +0000 (+1300) Subject: mkimage: Pad DTBs to target-specific pointer size X-Git-Tag: grub-2.04-rc1~112 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0a9f534782776a290074bdf4ddd434e55dd7232;p=thirdparty%2Fgrub.git mkimage: Pad DTBs to target-specific pointer size Device tree (DTB) lengths are being padded to a multiple of 4 bytes rather than the target-specific pointer size. This causes objects following OBJ_TYPE_DTB objects to be incorrectly parsed during GRUB execution on arm64. Fix by using ALIGN_ADDR(), not ALIGN_UP(). Signed-by-off: Matthew Daley Reviewed-by: Daniel Kiper --- diff --git a/util/mkimage.c b/util/mkimage.c index e22d82afa..b2f43fea6 100644 --- a/util/mkimage.c +++ b/util/mkimage.c @@ -829,7 +829,7 @@ grub_install_generate_image (const char *dir, const char *prefix, if (dtb_path) { - dtb_size = ALIGN_UP(grub_util_get_image_size (dtb_path), 4); + dtb_size = ALIGN_ADDR(grub_util_get_image_size (dtb_path)); total_module_size += dtb_size + sizeof (struct grub_module_header); }