From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gKA5a-0007sa-0a for mharc-grub-devel@gnu.org; Tue, 06 Nov 2018 17:44:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53312) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gKA5Y-0007sL-0R for grub-devel@gnu.org; Tue, 06 Nov 2018 17:44:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gKA5U-0000Xc-Sf for grub-devel@gnu.org; Tue, 06 Nov 2018 17:44:47 -0500 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]:42774) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gKA5P-00080W-Ta for grub-devel@gnu.org; Tue, 06 Nov 2018 17:44:42 -0500 Received: by mail-pl1-x641.google.com with SMTP id t6-v6so6898082plo.9 for ; Tue, 06 Nov 2018 14:44:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bugfuzz-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=2C/AvF1QL8CBpIdwnRe22An34lorIg6X+00gAPYzIeI=; b=1U0grbAzIRFZ2sbAEKUwXyh5hZxQDEOak7UOXnuH++oUBlAC60utCDQq1DG1NsWFyT d74n78Z5IOy7730+Kt+Fl4L52QU6yyowp4nonn63wa7ELvtLGAtW0rZkQT4iDcKGkYKX rgd0tg/9rlduUy9IzJfUWlgJcvUKrfUMSTvVztfPDEhM/AJMmc1BkiHkv1dMdb2rlgo+ wB10SgvbGKukSWK37mQbyvFvnGrE6u6KeLUX2gqEyIu4sxRkzJdkPlbu2dBPKgXXlPDx gR6HN+TMuNDag0l6D83on8XCoHYV+btBABehVx0piE76SEYBRv9urNoQiMlXeMg4SNHh lhyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=2C/AvF1QL8CBpIdwnRe22An34lorIg6X+00gAPYzIeI=; b=R8xrSygenCvJlR2IRzIa29Oi1bc8+2kry5GhKlJ2e9ol4+Eu2nxOSrDsx1QJVD0kmU 0I/ohpTCK4ek1Wbr41miLvV1L2cnRot13bV9sUgTJx2vudCXf3IJi5weebcY9BQ0NUeL nF3HNH7bVYy+JPgaGJ4lgMkx4HOdW4MEwnAdvw4j+Vv6K2ESpr+iOqGNLzCg+Knyif9d hj+E9VTWzHpixXNpMwomrZRwgn63/ASfUpKtNDBZj+q/hJJfOeJwJj/Dr0/ivMFtkJuo EOqojbyDHeN0nUsK2iEedd52grz5Prcb4w23kG6eWfAtHo9c/JgAh9tDxghyS64FKchd gAdw== X-Gm-Message-State: AGRZ1gJwtrezD6WGpO3UV2duu4zSwY56Oczd/ZD5+A3m1M8XV+j2KevG CfQkrbggShhNHnyrEWiSITubUMWwFuI= X-Google-Smtp-Source: AJdET5e7UbUxNqC1RbqpuOpMAix4Ti3rDcjsxYZnH84m9GW/Mi2CkVGwA2rMImYvm3hFX0Hpf3DUqg== X-Received: by 2002:a17:902:bc4a:: with SMTP id t10-v6mr14011796plz.249.1541544259720; Tue, 06 Nov 2018 14:44:19 -0800 (PST) Received: from konrul.mattnet.internal (125-238-47-44-fibre.sparkbb.co.nz. [125.238.47.44]) by smtp.gmail.com with ESMTPSA id r1-v6sm65030996pfb.41.2018.11.06.14.44.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Nov 2018 14:44:18 -0800 (PST) From: Matthew Daley To: grub-devel@gnu.org Cc: Matthew Daley Subject: [PATCH] mkimage: pad DTBs to target-specific pointer size Date: Wed, 7 Nov 2018 11:44:08 +1300 Message-Id: <20181106224408.13163-1-mattd@bugfuzz.com> X-Mailer: git-send-email 2.11.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::641 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2018 22:44:48 -0000 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 --- 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