All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mkimage: pad DTBs to target-specific pointer size
@ 2018-11-06 22:44 Matthew Daley
  2018-11-14 16:34 ` Daniel Kiper
  0 siblings, 1 reply; 2+ messages in thread
From: Matthew Daley @ 2018-11-06 22:44 UTC (permalink / raw)
  To: grub-devel; +Cc: Matthew Daley

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>
---
 util/mkimage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
     }
 
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-14 16:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-06 22:44 [PATCH] mkimage: pad DTBs to target-specific pointer size Matthew Daley
2018-11-14 16:34 ` Daniel Kiper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.