Ubuntu 18.04: kexec-tool shows "kexec: elfcorehdr doesn't fit cells-size" if crashkernel reserved beyond 4GB

Bug #1851190 reported by Prabhakar Kushwaha on 2019-11-04
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Status tracked in Focal
Bionic
Undecided
dann frazier
Disco
Undecided
Unassigned
Eoan
Undecided
Unassigned
Focal
Undecided
Unassigned
grub2-signed (Ubuntu)
Status tracked in Focal
Bionic
Undecided
Unassigned
Disco
Undecided
Unassigned
Eoan
Undecided
Unassigned
Focal
Undecided
Unassigned

Bug Description

[Impact]
On arm64, kexec throws following errors if crashkernel is reserved beyond 4GB of system memory.

[Test Case]
Create an arm64 guest w/ say 6GiB of memory.
Add crashkernel=1G@4G to kernel boot args

$ kexec -p /boot/vmlinuz-`uname -r` --initrd=/boot/initrd.img-`uname
-r` --reuse-cmdline
$ kexec: elfcorehdr doesn't fit cells-size.
$ kexec: setup_2nd_dtb failed.
$ kexec: load failed.
$ Cannot load /boot/vmlinuz-5.4.0-rc4+

[Fix]
Backport the following upstream commits:
347210a5d efi/fdt: Set address/size cells to 2 for empty tree
e93fd6b77 fdt: Move prop_entry_size to fdt.h

[Regression Risk]
Changes are restricted to efi/fdt code in GRUB, so regressions would be most likely on ARM platforms, specifically those that boot using ACPI (mostly servers).

dann frazier (dannf) on 2019-11-04
Changed in grub2 (Ubuntu Bionic):
assignee: nobody → dann frazier (dannf)
status: New → In Progress
Changed in grub2 (Ubuntu Focal):
status: New → Fix Released
Changed in grub2 (Ubuntu Eoan):
status: New → Fix Released
Changed in grub2 (Ubuntu Disco):
status: New → Fix Released
dann frazier (dannf) on 2019-11-04
description: updated
dann frazier (dannf) wrote :

Fix for bionic is pending approval from the stable release update team.

Changed in grub2 (Ubuntu Bionic):
status: In Progress → Fix Committed

Hello Prabhakar, or anyone else affected,

Accepted grub2 into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/grub2/2.02-2ubuntu8.14 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

tags: added: verification-needed verification-needed-bionic
Changed in grub2-signed (Ubuntu Bionic):
status: New → Fix Committed
Timo Aaltonen (tjaalton) wrote :

Hello Prabhakar, or anyone else affected,

Accepted grub2-signed into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/grub2-signed/1.93.15 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in grub2-signed (Ubuntu Disco):
status: New → Fix Released
Changed in grub2-signed (Ubuntu Eoan):
status: New → Fix Released
Changed in grub2-signed (Ubuntu Focal):
status: New → Fix Released
dann frazier (dannf) wrote :

Verification:

ubuntu@bionic:~$ sudo kexec -p /boot/vmlinuz-`uname -r` --initrd=/boot/initrd.img-`uname -r` --reuse-cmdline
ubuntu@bionic:~$ echo 1 | sudo tee /proc/sys/kernel/sysrq
1
ubuntu@bionic:~$ echo c | sudo tee /proc/sysrq-trigger
c
[ 164.962517] sysrq: SysRq : Trigger a crash
[ 164.968259] Internal error: Accessing user space memory outside uaccess.h routines: 96000044 [#1] SMP
[ 164.980205] Modules linked in: isofs nls_iso8859_1 sch_fq_codel ib_iser rdma_cm iw_cm ib_cm ib_core iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi ip_tables x_tables autofs4 btrfs zstd_compress raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid1 raid0 multipath linear virtio_blk virtio_net aes_neon_bs aes_neon_blk crypto_simd cryptd aes_arm64
[ 165.027333] Process tee (pid: 995, stack limit = 0x (ptrval))
[ 165.035125] CPU: 0 PID: 995 Comm: tee Not tainted 4.15.0-70-generic #79-Ubuntu
[ 165.043884] Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015
[ 165.052153] pstate: 00400005 (nzcv daif +PAN -UAO)
[ 165.057891] pc : sysrq_handle_crash+0x24/0x30
[ 165.063361] lr : __handle_sysrq+0xbc/0x1c0
[ 165.068316] sp : ffff00000b993d50
[ 165.072308] x29: ffff00000b993d50 x28: ffff800173b73c00
[ 165.078722] x27: ffff000008b42000 x26: 0000000000000040
[ 165.085075] x25: 0000000000000124 x24: ffff0000095ce000
[ 165.091453] x23: 0000000000000007 x22: 0000000000000002
[ 165.097766] x21: 0000000000000063 x20: ffff000009530000
[ 165.104181] x19: ffff0000095cea80 x18: ffffffffffffffff
[ 165.110614] x17: 0000000000000000 x16: 0000000000000000
[ 165.117007] x15: ffff000009508c08 x14: ffff0000896b6ce7
[ 165.123376] x13: ffff0000096b6cf5 x12: ffff000009530000
[ 165.129697] x11: ffff000009509660 x10: ffff000008715e80
[ 165.136172] x9 : 00000000ffffffd0 x8 : 0000000000000017
[ 165.142496] x7 : 53203a7172737973 x6 : ffff80017fdce2e8
[ 165.148990] x5 : ffff80017fdce2e8 x4 : 0000000000000000
[ 165.155352] x3 : ffff80017fdd66c8 x2 : cc0b9440e8d0c900
[ 165.161663] x1 : 0000000000000000 x0 : 0000000000000001
[ 165.168036] Call trace:
[ 165.171053] sysrq_handle_crash+0x24/0x30
[ 165.175855] __handle_sysrq+0xbc/0x1c0
[ 165.180378] write_sysrq_trigger+0xb8/0x120
[ 165.185223] proc_reg_write+0x80/0xc0
[ 165.189608] __vfs_write+0x48/0x80
[ 165.193883] vfs_write+0xac/0x1b0
[ 165.197962] SyS_write+0x74/0xf0
[ 165.201976] el0_svc_naked+0x30/0x34
[ 165.206719] Code: 52800020 b90ca020 d5033e9f d2800001 (39000020)
[ 165.252678] Starting crashdump kernel...
[ 165.257367] Bye!
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x500f0000]
[ 0.000000] Linux version 4.15.0-70-generic (buildd@bos02-arm64-021) (gcc version 7.4.0 (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1)) #79-Ubuntu SMP Tue Nov 12 10:36:10 UTC 2019 (Ubuntu 4.15.0-70.79-generic 4.15.18)
[ 0.000000] efi: Getting EFI parameters from FDT:
[ 0.000000] efi: EFI v2.70 by EDK II
...

tags: added: verification-done
removed: verification-needed
tags: added: verification-done-bionic
removed: verification-needed-bionic
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub2 - 2.02-2ubuntu8.14

---------------
grub2 (2.02-2ubuntu8.14) bionic; urgency=medium

  * Fix kexec on ACPI/UEFI ARM systems w/ crashkernel reserved memory
    beyond the 4GiB boundary. (LP: #1851190)
  * Apply patch from Peter Jones to forbid the "devicetree" command when
    Secure Boot is enabled. (LP: #1851897)

 -- dann frazier <email address hidden> Sun, 10 Nov 2019 22:52:35 -0700

Changed in grub2 (Ubuntu Bionic):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for grub2 has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub2-signed - 1.93.15

---------------
grub2-signed (1.93.15) bionic; urgency=medium

  * Rebuild against grub2 2.02-2ubuntu8.14. (LP: #1851190) (LP: #1851897)

 -- dann frazier <email address hidden> Sat, 09 Nov 2019 08:50:43 -0700

Changed in grub2-signed (Ubuntu Bionic):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers