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 <mattd@bugfuzz.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
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);
}