Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-4401

Error when loading large initrd (~1 GiB) on UEFI: out of memory

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Critical Critical
    • rhel-9.4
    • rhel-9.2.0
    • grub2
    • None
    • Important
    • rhel-bootloader
    • ssg_display
    • None
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • If docs needed, set a value
    • None
    • 57,005

      Description of problem:

      When we try to load a large initrd (~1 GiB) on UEFI with TPM disabled grub fails to load and prints a "out of memory" message.

      Version-Release number of selected component (if applicable):

      grub2-common-2.06-61.el9.noarch

      How reproducible:

      It always reproduces in the bare metal machine that we are using

      Model: Dell PowerEdge R340
      BIOS Version: 2.3.5
      iDRAC Firmware Version: 4.22.00.53

      Steps to Reproduce:

      1. Prepare a boot entry like this:

      set timeout=10
      set default=0
      menuentry 'Agent-Based Installer'

      { search --set=root --label agentboot load_video set gfx_payload=keep insmod gzio linux /images/pxeboot/vmlinuz random.trust_cpu=on console=tty0 console=ttyS0,115200n8 ignition.firstboot ignition.platform.id=metal ro initrd /images/pxeboot/initrd.img /images/ignition.img /images/pxeboot/rootfs.img }

      What is most relevant of this boot entry is the size of the initrd files, specially the rootfs:

      1. ls -lh pxeboot/initrd.img ignition.img pxeboot/rootfs.img
        rrr-. 1 root root 256K May 2 20:15 ignition.img
        rrr-. 1 root root 81M May 2 20:20 pxeboot/initrd.img
        rrr-. 1 root root 952M May 2 20:20 pxeboot/rootfs.img

      Total size is approximately 1 GiB.

      2. Ensure that TPM is enabled in the BIOS.

      3. Boot the machine.

      Actual results:

      Grub fails with the following error message:

      error: ../../grub-core/kern/mm.c:552:out of memory.
      Press any key to continue...

      After that the kernel is started anyhow, but it fails to locate the root filesystem and panics.

      Expected results:

      The initrd should be loaded and the machine should boot correctly.

      Additional info:

      We found that the issue is related to having TPM enabled. We applied the following patch to grub2-common-2.06-61.el9.noarch:

      https://github.com/rhboot/grub2/commit/b09440df05755c665cac9b93dd654e661c655c38

      Then we rebuilt the RPM used the resulting grubx64.efi. With that the boot still fails in the same way. But it does work if we also disable TPM.

      So the workaround is to disable TPM and apply the patch.

      We would like to be able to boot with TPM enabled or disabled.

              bootloader-eng-team bootloader -eng-team
              jhernand-rh Juan Hernández
              bootloader -eng-team bootloader -eng-team
              Release Test Team Release Test Team
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: