From: Lennart Poettering Date: Mon, 25 Jul 2022 22:13:06 +0000 (+0200) Subject: stub: measure PE sections in a defined order, and include all sections X-Git-Tag: v252-rc1~542^2~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=16700cb85ab2d815dec3f489c3280f264ea23a86;p=thirdparty%2Fsystemd.git stub: measure PE sections in a defined order, and include all sections --- diff --git a/src/boot/efi/stub.c b/src/boot/efi/stub.c index 9ec01d1baa6..1afbde32952 100644 --- a/src/boot/efi/stub.c +++ b/src/boot/efi/stub.c @@ -150,8 +150,10 @@ static void export_variables(EFI_LOADED_IMAGE_PROTOCOL *loaded_image) { EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) { enum Section { - SECTION_CMDLINE, + /* This is the canonical order in which we measure the sections. PLEASE DO NOT REORDER! */ SECTION_LINUX, + SECTION_OSREL, + SECTION_CMDLINE, SECTION_INITRD, SECTION_SPLASH, SECTION_DTB, @@ -159,8 +161,9 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) { }; static const char * const sections[_SECTION_MAX + 1] = { - [SECTION_CMDLINE] = ".cmdline", [SECTION_LINUX] = ".linux", + [SECTION_OSREL] = ".osrel", + [SECTION_CMDLINE] = ".cmdline", [SECTION_INITRD] = ".initrd", [SECTION_SPLASH] = ".splash", [SECTION_DTB] = ".dtb",