1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-18 06:03:42 +03:00

stub: Use EfiLoaderCode for kernel memory

Fixes: #24237
(cherry picked from commit 79a7ef89aa5dd9d99a904f1253bad7512d3feee5)
(cherry picked from commit 7dacfb3fb4eaceedf994705d63fa1a1b72f8f12a)
This commit is contained in:
Jan Janssen 2022-08-08 11:50:01 +02:00 committed by Zbigniew Jędrzejewski-Szmek
parent a9b264eb6b
commit b2082bbad0

View File

@ -146,7 +146,7 @@ EFI_STATUS linux_exec(
*/
/* allocate SizeOfImage + SectionAlignment because the new_buffer can move up to Alignment-1 bytes */
kernel.num = EFI_SIZE_TO_PAGES(ALIGN_TO(kernel_size_of_image, kernel_alignment) + kernel_alignment);
err = BS->AllocatePages(AllocateAnyPages, EfiLoaderData, kernel.num, &kernel.addr);
err = BS->AllocatePages(AllocateAnyPages, EfiLoaderCode, kernel.num, &kernel.addr);
if (EFI_ERROR(err))
return EFI_OUT_OF_RESOURCES;
new_buffer = PHYSICAL_ADDRESS_TO_POINTER(ALIGN_TO(kernel.addr, kernel_alignment));