Bug 2129888

Summary: initramfs unpacking failed: uncompression error for certain initrd sizes
Product: Red Hat Enterprise Linux 8 Reporter: Pavel Cahyna <pcahyna>
Component: grub2Assignee: Bootloader engineering team <bootloader-eng-team>
Status: CLOSED MIGRATED QA Contact: Release Test Team <release-test-team-automation>
Severity: high Docs Contact:
Priority: unspecified    
Version: 8.0Keywords: MigratedToJIRA
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-16 17:12:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2122326    

Description Pavel Cahyna 2022-09-26 14:23:12 UTC
Description of problem:

With a certain size of initrd, the kernel will print 

Initramfs unpacking failed: uncompression error
or
Initramfs unpacking failed: junk in compressed archive

(and then panic as it won't be able to mount the initrd).

I have tried to identify the problematic initrd sizes.
Initrd of 429055538 bytes (and smaller) worked, 429061102 bytes and larger are broken, up to 463840156 bytes. 463841919 bytes and larger work properly again. This was with kernel vmlinuz-4.18.0-424.el8.x86_64. With kernels vmlinuz-5.14.0-162.el9.x86_64 and vmlinuz-5.14.0-70.13.1.el9_0.x86_64 (from RHEL 9) the problem persists, but the boundary between working and non-working initrd sizes shifts a bit.

I am convinced that it is a problem with GRUB and not with the kernel or with the initrd generating tools (gzip, cpio), because installing GRUB from RHEL 7.9 avoids the problem (with the same kernel and initrd that have the problem on RHEL 8).

I can reproduce the problem in RHEL 8.0 and the newest RHEL 8.7, also in RHEL 9.0 and 9.1.

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

1:2.02-66.el8

How reproducible:

Well reproducible with a right initrd size, can be obtained by adding a large file with random data to the initrd.

Steps to Reproduce:
1. dd if=/dev/urandom of=/root/fill bs=1024 count=350000
2. dracut -N --force --include /root/fill /usr/lib/fill /boot/initramfs-4.18.0-425.1.1.el8.x86_64.big.img
3. in GRUB menu, change the boot entry to boot from /boot/initramfs-4.18.0-425.1.1.el8.x86_64.big.img instead of the default /boot/initramfs-4.18.0-425.1.1.el8.x86_64.img

Actual results:
Kernel panic, preceded by the message above

Expected results:
kernel+initrd should boot normally

Additional info:

The problem does not happen when booting with SYSLINUX. I was not able to reproduce it on UEFI machines, only on BIOS machines. I got a panic with sufficiently large initrd on popc64le (PowerVM with OpenFirmware) as well, but the boundary between working and non-working initrd size is different (initrd of size 393955235 was broken, 188900948 worked).

Comment 1 RHEL Program Management 2023-09-16 17:09:41 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 2 RHEL Program Management 2023-09-16 17:12:12 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.