[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 14/14] efi: change heap allocation type to GRUB_EFI_LOADER_COD

From: Leif Lindholm
Subject: [PATCH v2 14/14] efi: change heap allocation type to GRUB_EFI_LOADER_CODE
Date: Thu, 3 Aug 2017 11:04:32 +0100

With upcoming changes to EDK2, allocations of type EFI_LOADER_DATA may
not return regions with execute ability. Since modules are loaded onto
the heap, change the heap allocation type to GRUB_EFI_LOADER_CODE in
order to permit execution on systems with this feature enabled.

Closes: 50420

Signed-off-by: Leif Lindholm <address@hidden>
 grub-core/kern/efi/mm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c
index c8fffe902..f1424f2e4 100644
--- a/grub-core/kern/efi/mm.c
+++ b/grub-core/kern/efi/mm.c
@@ -448,7 +448,9 @@ add_memory_regions (grub_efi_memory_descriptor_t 
          pages = required_pages;
-      addr = grub_efi_allocate_pages (start, pages);
+      addr = grub_efi_allocate_pages_real (start, pages,
+                                          GRUB_EFI_ALLOCATE_ADDRESS,
+                                          GRUB_EFI_LOADER_CODE);
       if (! addr)
        grub_fatal ("cannot allocate conventional memory %p with %u pages",
                    (void *) ((grub_addr_t) start),

reply via email to

[Prev in Thread] Current Thread [Next in Thread]