Patch "efi/libstub: arm64: Fix image check alignment at entry" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    efi/libstub: arm64: Fix image check alignment at entry

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     efi-libstub-arm64-fix-image-check-alignment-at-entry.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 33accaea19eb94b30f5d6fbb97589ffedead7e5c
Author: Mihai Carabas <mihai.carabas@xxxxxxxxxx>
Date:   Wed Jan 19 18:14:27 2022 +0200

    efi/libstub: arm64: Fix image check alignment at entry
    
    [ 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@xxxxxxxxxx>
    Signed-off-by: Ard Biesheuvel <ardb@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/firmware/efi/libstub/arm64-stub.c b/drivers/firmware/efi/libstub/arm64-stub.c
index 2363fee9211c9..9cc556013d085 100644
--- a/drivers/firmware/efi/libstub/arm64-stub.c
+++ b/drivers/firmware/efi/libstub/arm64-stub.c
@@ -119,9 +119,9 @@ efi_status_t handle_kernel_image(unsigned long *image_addr,
 	if (image->image_base != _text)
 		efi_err("FIRMWARE BUG: efi_loaded_image_t::image_base has bogus value\n");
 
-	if (!IS_ALIGNED((u64)_text, EFI_KIMG_ALIGN))
-		efi_err("FIRMWARE BUG: kernel image not aligned on %ldk boundary\n",
-			EFI_KIMG_ALIGN >> 10);
+	if (!IS_ALIGNED((u64)_text, SEGMENT_ALIGN))
+		efi_err("FIRMWARE BUG: kernel image not aligned on %dk boundary\n",
+			SEGMENT_ALIGN >> 10);
 
 	kernel_size = _edata - _text;
 	kernel_memsize = kernel_size + (_end - _edata);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux