]> git.ipfire.org Git - thirdparty/grub.git/commit
nx: Set the NX compatible flag for the GRUB EFI images
authorMate Kukri <mate.kukri@canonical.com>
Wed, 9 Oct 2024 08:16:42 +0000 (09:16 +0100)
committerDaniel Kiper <daniel.kiper@oracle.com>
Fri, 11 Oct 2024 12:45:00 +0000 (14:45 +0200)
commitf5bb766e688b1180e0ace3417d4947a934957a31
tree82901ed31c6dd5ceb2d3e3254a4940d7f2063f0a
parent94649c02670dae12c188cae471b9ae246b48f428
nx: Set the NX compatible flag for the GRUB EFI images

For NX the GRUB binary has to announce that it is compatible with the
NX feature. This implies that when loading the executable GRUB image
several attributes are true:
  - the binary doesn't need an executable stack,
  - the binary doesn't need sections to be both executable and writable,
  - the binary knows how to use the EFI Memory Attributes Protocol on code
    it is loading.

This patch:
  - adds a definition for the PE DLL Characteristics flag GRUB_PE32_NX_COMPAT,
  - changes grub-mkimage to set that flag.

Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Jan Setje-Eilers <jan.setjeeilers@oracle.com>
Signed-off-by: Mate Kukri <mate.kukri@canonical.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
include/grub/efi/pe32.h
util/mkimage.c