efi_remap_image(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ efi_remap_image(9) πŸ¦‹

okay bestie, welcome to the Kernel API Manual, and today's main character is efi_remap_image β€” the function that gives your loaded image the correct permissions for code and data. slay. πŸ’…


✨ NAME ✨

efi_remap_image β€” Remap a loaded image with the appropriate permissions for code and data


🌸 SYNOPSIS 🌸

void efi_remap_image (unsigned long image_base , unsigned alloc_size ,
       unsigned long code_size );

πŸŽ€ ARGUMENTS πŸŽ€

  • image_base β€” the base of the image in memory, iykyk
  • alloc_size β€” the size of the area in memory occupied by the image
  • code_size β€” the size of the leading part of the image containing code and read-only data

πŸ’– DESCRIPTION πŸ’–

So here's the tea, bestie: efi_remap_image uses the EFI memory attribute protocol to remap the code region of the loaded image read-only/executable, and the remainder read-write/non-executable. no cap. πŸ”₯

The code region is assumed to start at the base of the image, and will therefore cover the PE/COFF header as well. it's giving "the header is along for the ride" energy. 🫢


🌈 SEE ALSO 🌈

Kernel file ./drivers/firmware/efi/libstub/efi-stub-helper.c

efi_parse_options(9), efi_exit_boot_services(9), get_efi_config_table(9), efi_load_initrd_dev_path(9), efi_load_initrd(9), efi_wait_for_key(9)


and that's the whole vibe, periodt. πŸ’œ

this page came from ./drivers/firmware/efi/libstub, dated October 2026 β€” drink some water, bestie, and go remap something beautiful. πŸŽ€βœ¨

πŸ“¦ where this page comes from