Skip to content

Commit e9b7c3a

Browse files
mcarabasardbiesheuvel
authored andcommitted
efi/libstub: arm64: Fix image check alignment at entry
The kernel is aligned at SEGMENT_SIZE and this is the size populated in the PE headers: arch/arm64/kernel/efi-header.S: .long SEGMENT_ALIGN // SectionAlignment EFI_KIMG_ALIGN is defined as: (SEGMENT_ALIGN > THREAD_ALIGN ? SEGMENT_ALIGN : THREAD_ALIGN) So it depends on THREAD_ALIGN. On newer builds this message started to appear even though the loader is taking into account the PE header (which is stating SEGMENT_ALIGN). Fixes: c32ac11 ("efi/libstub: arm64: Double check image alignment at entry") Signed-off-by: Mihai Carabas <[email protected]> Signed-off-by: Ard Biesheuvel <[email protected]>
1 parent e783362 commit e9b7c3a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/firmware/efi/libstub/arm64-stub.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ efi_status_t handle_kernel_image(unsigned long *image_addr,
119119
if (image->image_base != _text)
120120
efi_err("FIRMWARE BUG: efi_loaded_image_t::image_base has bogus value\n");
121121

122-
if (!IS_ALIGNED((u64)_text, EFI_KIMG_ALIGN))
123-
efi_err("FIRMWARE BUG: kernel image not aligned on %ldk boundary\n",
124-
EFI_KIMG_ALIGN >> 10);
122+
if (!IS_ALIGNED((u64)_text, SEGMENT_ALIGN))
123+
efi_err("FIRMWARE BUG: kernel image not aligned on %dk boundary\n",
124+
SEGMENT_ALIGN >> 10);
125125

126126
kernel_size = _edata - _text;
127127
kernel_memsize = kernel_size + (_end - _edata);

0 commit comments

Comments
 (0)