]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
efistub/x86: Remap inittext read-execute when needed
authorArd Biesheuvel <ardb@kernel.org>
Thu, 28 Aug 2025 10:22:23 +0000 (12:22 +0200)
committerBorislav Petkov (AMD) <bp@alien8.de>
Wed, 3 Sep 2025 16:05:42 +0000 (18:05 +0200)
commite7b88bc0051c5062bdd73b58837cf277d0057358
tree298ec15fd6815e00e0f373f5dd02595c79fa005f
parent7b38dec3c5af54665a4b29483aa02bd1c1e71cf1
efistub/x86: Remap inittext read-execute when needed

Recent EFI x86 systems are more strict when it comes to mapping boot
images, and require that mappings are either read-write or read-execute.

Now that the boot code is being cleaned up and refactored, most of it is
being moved into .init.text [where it arguably belongs] but that implies
that when booting on such strict EFI firmware, we need to take care to
map .init.text (and the .altinstr_aux section that follows it)
read-execute as well.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/20250828102202.1849035-44-ardb+git@google.com
arch/x86/boot/compressed/Makefile
arch/x86/boot/compressed/misc.c
arch/x86/include/asm/boot.h
arch/x86/kernel/vmlinux.lds.S
drivers/firmware/efi/libstub/x86-stub.c