EFI stub: ERROR: FIRMWARE BUG: kernel image not aligned on 64k boundary

Bug #1947046 reported by dann frazier
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Fix Released
Undecided
Unassigned
Jammy
Fix Released
Undecided
Unassigned

Bug Description

[Impact]
Recent kernels emit the following error message when booting on arm64 platforms:

  EFI stub: ERROR: FIRMWARE BUG: kernel image not aligned on 64k boundary

While this doesn't appear to cause any functional issues - and indeed, the kernel commit that added the error[*] says "We can deal with this, but let's check for this condition anyway", it is still likely to cause user concern.

[*] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c32ac11da3f83bb42b986702a9b92f0a14ed4182

[Test Case]
Boot a recent kernel on an EFI-based arm64 system (impish will do, but the kernel patch is also hitting kernels in older releases). This message will be emitted after GRUB execs the kernel EFI stub.

[Fix]
https://github.com/rhboot/grub2/commit/6a5babc21e3ec665e0bae30e399db296451c121e

[What Could Go Wrong]

Tags: fr-2066
dann frazier (dannf)
no longer affects: grub2-unsigned (Ubuntu)
dann frazier (dannf)
description: updated
dann frazier (dannf)
description: updated
Changed in grub2 (Ubuntu):
status: New → In Progress
assignee: nobody → dann frazier (dannf)
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

I've experienced this after installing Impish host on Raspberry Pi 4 with an Impish VM. The VM was working correctly up until just a moment ago, as I type this, I've installed `linux-modules-extra-raspi in order to get usb serial adapters to work inside the virtual machine. The package installed normally and initrd was created normally as well. Upon reboot, the only thing I see is the error mentioned in this bug report (you can see it if you do: lxc start --attach) and the VM is spinning at 100% CPU but linux is not booting.

Revision history for this message
dann frazier (dannf) wrote :

@zyga: hm.. I wouldn't expect this to cause a functional problem, perhaps what you are seeing is unrelated. Can you try adding 'earlycon debug' to the kernel command line? If you see messages from the kernel with that, it's likely something else.

Changed in grub2 (Ubuntu):
milestone: none → ubuntu-20.04.4
Revision history for this message
Heinrich Schuchardt (xypron) wrote :

The error still occurs when installing https://cdimage.ubuntu.com/ubuntu-server/daily-live/current/jammy-live-server-arm64.iso when booting the installer kernel.

dann frazier (dannf)
Changed in grub2 (Ubuntu):
assignee: dann frazier (dannf) → nobody
Changed in grub2 (Ubuntu):
milestone: ubuntu-20.04.4 → focal-updates
tags: added: rls-jj-incoming
tags: added: fr-2066
tags: removed: rls-jj-incoming
Changed in grub2 (Ubuntu Jammy):
milestone: focal-updates → ubuntu-22.04-beta
Revision history for this message
Julian Andres Klode (juliank) wrote :

2.06-2ubuntu5 should fix this issue for insecure boot cases, a future version will also fix secure boot use cases, but the new code is undergoing security review.

SRUs might pick up the new code, or use the rhboot code, not decided yet.

Changed in grub2 (Ubuntu Jammy):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub2 - 2.06-2ubuntu5

---------------
grub2 (2.06-2ubuntu5) jammy; urgency=medium

  [ Julian Andres Klode ]
  * Free correct size when freeing params, rather than 16 Ki (LP: #1958623)
  * Build with FUSE3 (LP: #1935659)
  * Only run os-prober on first run and if it previously found other OS
    (LP: #1955109)

  [ Heinrich Schuchardt ]
  * Rename grub-core/loader/efi/linux.c
  * Add patches for GRUB on RISC-V
  * fat: fix listing the root directory
  * Enable building for RISC-V (LP: #1876620)

  [ Julian Andres Klode ]
  * Re-enable peimage code on other archs outside secure boot; this
    fixes LP: #1947046 when not booting in secure boot mode (secure
    boot pending security review of the code)

 -- Julian Andres Klode <email address hidden> Fri, 18 Feb 2022 17:21:16 +0100

Changed in grub2 (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Pascal van Dam (pamvdam) wrote :

Good afternoon,

This also effects the https://cdimage.ubuntu.com/daily-live/current/jammy-desktop-arm64.iso
image. Currently I can boot debian arm64 UEFI ISOs and Fedora, but not the Jammy cd image using PI uefi.

Any idea when this fix will be incorporated on the ISO so can do further testing?

Kind regards,

  Pascal van Dam

Revision history for this message
Akihiro Suda (suda-kyoto) wrote :

According to reports in https://github.com/lima-vm/lima/issues/712 , this issue seems also affecting Impish kernel 5.13.0-35.40 and Focal kernel 5.4.0-103.117 .

Could you backport the fix to Impish and Focal, and release a new cloud image (https://cloud-images.ubuntu.com/releases/) ?

Revision history for this message
Julian Andres Klode (juliank) wrote :

No, that fix is not reviewed for secure boot yet, but maybe we can cherry pick the other fixes.

Revision history for this message
Akihiro Suda (suda-kyoto) wrote :

Sorry, https://github.com/lima-vm/lima/issues/712 might not be related to this issue.

The reporters of https://github.com/lima-vm/lima/issues/712 say that the kernel doesn't boot at all after seeing the "EFI stub: ERROR: FIRMWARE BUG: kernel image not aligned on 64k boundary" lines.

They are using M1 macOS version of QEMU (https://gitlab.com/qemu-project/qemu/-/issues/899).

Revision history for this message
satyajit mohanty (lenevo-satyajit2014) wrote :

This also effects the https://cdimage.ubuntu.com/daily-live/current/jammy-desktop-arm64.iso

is there any fix to it yet?

Revision history for this message
Alan Baghumian (alanbach) wrote :

Focal HWE kernels (5.15) are also affected with this issue. Is there a chance we can back-port this to Focal as well?

Revision history for this message
Julian Andres Klode (juliank) wrote (last edit ):

This is included in focal-proposed with the 2.06-2ubuntu14 backport. For technical reasons, due to binary copying the version around, only a tracking bug and a handful more are being notified and verified and closed. To see the status, please track the grub2-unsigned tasks in

bug #1996950

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.