[Bug 1999881] [NEW] unmkinitramfs fails with symlinked zstd compressed initrds

Fabien Malfoy 1999881 at bugs.launchpad.net
Fri Dec 16 10:15:03 UTC 2022


Public bug reported:

[Impact]

 * Cannot unpack zstd compressed initrds when accessed through a
symbolic link

[Test Case]

$ grep COMPRESS= /etc/initramfs-tools/initramfs.conf
COMPRESS=zstd
# This is the default

$ stat -c '%F %N' /boot/initrd.img*
symbolic link '/boot/initrd.img' -> 'initrd.img-5.15.0-53-generic'
regular file '/boot/initrd.img-5.15.0-53-generic'

$ lsinitramfs /boot/initrd.img-5.15.0-53-generic
... works as expected ...

$ lsinitramfs /boot/initrd.img
cpio: premature end of archive

[Regression Potential]

 * Ubuntu Jammy changes the default compression scheme for the initrd
from lz4 to zstd. Unpacking lz4 initrds had already been fixed by
https://bugs.launchpad.net/ubuntu/cosmic/+source/initramfs-
tools/+bug/1832108 but unpacking zstd initrds works as expected when
directly accessing the file. However, it fails when accessing it through
a symbolic link.

[Other Info]

A fix proposal is attached.

$ lsb_release -rd
Description:	Ubuntu 22.04.1 LTS
Release:	22.04
$ dpkg-query -W initramfs-tools
initramfs-tools	0.140ubuntu13

** Affects: initramfs-tools (Ubuntu)
     Importance: Undecided
         Status: New

** Patch added: "Proposed fix"
   https://bugs.launchpad.net/bugs/1999881/+attachment/5635890/+files/proposed_fix.patch

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

Title:
  unmkinitramfs fails with symlinked zstd compressed initrds

Status in initramfs-tools package in Ubuntu:
  New

Bug description:
  [Impact]

   * Cannot unpack zstd compressed initrds when accessed through a
  symbolic link

  [Test Case]

  $ grep COMPRESS= /etc/initramfs-tools/initramfs.conf
  COMPRESS=zstd
  # This is the default

  $ stat -c '%F %N' /boot/initrd.img*
  symbolic link '/boot/initrd.img' -> 'initrd.img-5.15.0-53-generic'
  regular file '/boot/initrd.img-5.15.0-53-generic'

  $ lsinitramfs /boot/initrd.img-5.15.0-53-generic
  ... works as expected ...

  $ lsinitramfs /boot/initrd.img
  cpio: premature end of archive

  [Regression Potential]

   * Ubuntu Jammy changes the default compression scheme for the initrd
  from lz4 to zstd. Unpacking lz4 initrds had already been fixed by
  https://bugs.launchpad.net/ubuntu/cosmic/+source/initramfs-
  tools/+bug/1832108 but unpacking zstd initrds works as expected when
  directly accessing the file. However, it fails when accessing it
  through a symbolic link.

  [Other Info]

  A fix proposal is attached.

  $ lsb_release -rd
  Description:	Ubuntu 22.04.1 LTS
  Release:	22.04
  $ dpkg-query -W initramfs-tools
  initramfs-tools	0.140ubuntu13

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/1999881/+subscriptions




More information about the foundations-bugs mailing list