From: Matthew Daley <mattd@bugfuzz.com>
To: grub-devel@gnu.org
Cc: Matthew Daley <mattd@bugfuzz.com>
Subject: [PATCH] mkimage: pad DTBs to target-specific pointer size
Date: Wed, 7 Nov 2018 11:44:08 +1300 [thread overview]
Message-ID: <20181106224408.13163-1-mattd@bugfuzz.com> (raw)
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
next reply other threads:[~2018-11-06 22:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-06 22:44 Matthew Daley [this message]
2018-11-14 16:34 ` [PATCH] mkimage: pad DTBs to target-specific pointer size Daniel Kiper
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=20181106224408.13163-1-mattd@bugfuzz.com \
--to=mattd@bugfuzz.com \
--cc=grub-devel@gnu.org \
/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 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.