]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
efi/libstub: arm64: Fix image check alignment at entry
authorMihai Carabas <mihai.carabas@oracle.com>
Wed, 19 Jan 2022 16:14:27 +0000 (18:14 +0200)
committerPaolo Pisati <paolo.pisati@canonical.com>
Thu, 3 Feb 2022 09:28:53 +0000 (10:28 +0100)
commit634a917731a69415217d6921f0a8eea6551c1a37
tree8453fd913c636d3890d72e97ec0a175066d8f564
parentd60c00a851cd5ca3c44331847aca040996fbe2a3
efi/libstub: arm64: Fix image check alignment at entry

BugLink: https://bugs.launchpad.net/bugs/1959879
[ Upstream commit e9b7c3a4263bdcfd31bc3d03d48ce0ded7a94635 ]

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: c32ac11da3f8 ("efi/libstub: arm64: Double check image alignment at entry")
Signed-off-by: Mihai Carabas <mihai.carabas@oracle.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/firmware/efi/libstub/arm64-stub.c