[Bug 2087778] [NEW] Memory management error in HTTP boot

Heinrich Schuchardt 2087778 at bugs.launchpad.net
Sun Nov 10 12:01:45 UTC 2024


Public bug reported:

I have set up an HTTP server to be used for HTTP boot.

Here I have the following files:

/arm64/grubnetaa64.efi (from grub-efi-arm64-unsigned_2.12-5ubuntu5.1_arm64.deb)
/arm64/vmlinuz-6.11.0-8-generic (from linux-image-unsigned-6.11.0-8-generic_6.11.0-8.8_arm64.deb)

I have unzipped the kernel with

mv vmlinuz-6.11.0-8-generic vmlinuz-6.11.0-8-generic.gz
gzip -d vmlinuz-6.11.0-8-generic.gz

I have installed qemu-system-arm and qemu-efi-aarch64.

I have copied /usr/share/qemu-efi-aarch64/*.fd to my work directory.

I start EDK II on QEMU with:

qemu-system-aarch64 \
-M virt -accel tcg -m 4096 -smp 4 -cpu max \
-nographic \
-drive if=pflash,format=raw,unit=0,file=AAVMF_CODE.fd,readonly=on \
-drive if=pflash,format=raw,unit=1,file=AAVMF_VARS.fd \
-device virtio-net-device,netdev=n1 \
-netdev user,id=n1,bootfile=http://10.0.0.43/arm64/grubnetaa64.efi

In the boot manager menu I choose "UEFI HTTPv4 (MAC:525400123456)" and
arrive at the grub rescue console.

Loading a first file with the Linux command works fine. But when try a
non-existent file afterwards GRUB generates a fatal error after which it
will exit:

grub> linux (http,10.0.0.43)/arm64/vmlinuz-6.11.0-8-generic
grub> linux (http,10.0.0.43)/arm64/foo                     
error: file `/arm64/foo' not found.
grub_efi_drop_alloc() called with wrong page count
Aborted. Press any key to exit.

I have seen the same error on a development branch of U-Boot. So it
seems not to be a problem with EDK II.

U-Boot provides a little more debug information:

efi_free_pages: illegal free 0x13d315000, 0x0

I would have expected GRUB not to call grub_efi_drop_alloc() if no
memory was allocated.

Best regards

Heinrich

** Affects: grub2 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to grub2 in Ubuntu.
https://bugs.launchpad.net/bugs/2087778

Title:
  Memory management error in HTTP boot

Status in grub2 package in Ubuntu:
  New

Bug description:
  I have set up an HTTP server to be used for HTTP boot.

  Here I have the following files:

  /arm64/grubnetaa64.efi (from grub-efi-arm64-unsigned_2.12-5ubuntu5.1_arm64.deb)
  /arm64/vmlinuz-6.11.0-8-generic (from linux-image-unsigned-6.11.0-8-generic_6.11.0-8.8_arm64.deb)

  I have unzipped the kernel with

  mv vmlinuz-6.11.0-8-generic vmlinuz-6.11.0-8-generic.gz
  gzip -d vmlinuz-6.11.0-8-generic.gz

  I have installed qemu-system-arm and qemu-efi-aarch64.

  I have copied /usr/share/qemu-efi-aarch64/*.fd to my work directory.

  I start EDK II on QEMU with:

  qemu-system-aarch64 \
  -M virt -accel tcg -m 4096 -smp 4 -cpu max \
  -nographic \
  -drive if=pflash,format=raw,unit=0,file=AAVMF_CODE.fd,readonly=on \
  -drive if=pflash,format=raw,unit=1,file=AAVMF_VARS.fd \
  -device virtio-net-device,netdev=n1 \
  -netdev user,id=n1,bootfile=http://10.0.0.43/arm64/grubnetaa64.efi

  In the boot manager menu I choose "UEFI HTTPv4 (MAC:525400123456)" and
  arrive at the grub rescue console.

  Loading a first file with the Linux command works fine. But when try a
  non-existent file afterwards GRUB generates a fatal error after which
  it will exit:

  grub> linux (http,10.0.0.43)/arm64/vmlinuz-6.11.0-8-generic
  grub> linux (http,10.0.0.43)/arm64/foo                     
  error: file `/arm64/foo' not found.
  grub_efi_drop_alloc() called with wrong page count
  Aborted. Press any key to exit.

  I have seen the same error on a development branch of U-Boot. So it
  seems not to be a problem with EDK II.

  U-Boot provides a little more debug information:

  efi_free_pages: illegal free 0x13d315000, 0x0

  I would have expected GRUB not to call grub_efi_drop_alloc() if no
  memory was allocated.

  Best regards

  Heinrich

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/2087778/+subscriptions




More information about the foundations-bugs mailing list