]> git.ipfire.org Git - thirdparty/grub.git/commit
mkimage: Align efi sections on 4k boundary
authorAlexander Graf <agraf@suse.de>
Mon, 28 Jan 2019 13:35:28 +0000 (14:35 +0100)
committerDaniel Kiper <daniel.kiper@oracle.com>
Wed, 6 Feb 2019 10:34:50 +0000 (11:34 +0100)
commita51f953f4ee87cbfbf25a7df564304c5e9fea6a0
treed4f441cbd1de4d10d12d7ffe5a6ca1caa07f0ecf
parente347f40c1af2457a634af71e3cc75e851c641847
mkimage: Align efi sections on 4k boundary

There is UEFI firmware popping up in the wild now that implements stricter
permission checks using NX and write protect page table entry bits.

This means that firmware now may fail to load binaries if its individual
sections are not page aligned, as otherwise it can not ensure permission
boundaries.

So let's bump all efi section alignments up to 4k (EFI page size). That way
we will stay compatible going forward.

Unfortunately our internals can't deal very well with a mismatch of alignment
between the virtual and file offsets, so we have to also pad our target
binary a bit.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Julien ROBIN <julien.robin28@free.fr>
include/grub/efi/pe32.h