grub 2.12~rc1 fails to load files from large directories on XFS

Bug #2039172 reported by Julian Andres Klode
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
grub2 (Debian)
Fix Released
Unknown
grub2 (Ubuntu)
Status tracked in Noble
Mantic
New
Undecided
Unassigned
Noble
Fix Released
High
Unassigned
ubuntu-release-upgrader (Ubuntu)
Status tracked in Noble
Mantic
Fix Committed
High
Unassigned
Noble
Fix Released
High
Unassigned

Bug Description

[Impact]
Multi-extent directories are not parsed correctly by grub's XFS code in 2.12~rc1, preventing it from loading files from directories with too many entries, such as the grub module directory.

This should only affect BIOS systems as they need to load the core grub modules from the module directory, whereas UEFI systems have them embedded in the ESP EFI image.

[Test plan]

On systems BIOS systems with XFS /boot, or XFS / and no separate boot partition, the upgrade should be prevented early on with a message linking to this bug report.

We should also test upgrades on "normal"/unaffected system to make sure it is not unnecessarily prevented.

[Where problems could occur]
The two risks here are (1) missing a case where we should block upgrade, and (2) preventing an upgrade in a case where we should not. The unit tests included in the patch attempt to mitigate this risk.

Any issues would probably come from logic errors in the code that parses /proc/mounts.

Related branches

CVE References

description: updated
Changed in grub2 (Ubuntu):
status: New → Triaged
importance: Undecided → High
Changed in grub2 (Debian):
status: Unknown → Confirmed
Revision history for this message
Steve Langasek (vorlon) wrote :

As we don't have a fix for this in grub yet, we want ubuntu-release-upgrader to block upgrades to mantic in the meantime if it detects that /boot is on xfs.

Revision history for this message
Steve Langasek (vorlon) wrote :

--> if /boot is on xfs AND the system is not booted under UEFI, since we do not expect this to impact bootability when using the unified grub.efi image.

tags: added: foundations-todo
Revision history for this message
Steve Langasek (vorlon) wrote :

the check for whether the system is booted under UEFI is [ -d /sys/firmware/efi ]

Changed in ubuntu-release-upgrader (Ubuntu Noble):
importance: Undecided → High
status: New → Triaged
milestone: none → noble-updates
Changed in ubuntu-release-upgrader (Ubuntu Mantic):
status: New → Triaged
importance: Undecided → High
milestone: none → mantic-updates
Nick Rosbrook (enr0n)
description: updated
Nick Rosbrook (enr0n)
description: updated
Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

Hello Julian, or anyone else affected,

Accepted ubuntu-release-upgrader into mantic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ubuntu-release-upgrader/1:23.10.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, what testing has been performed on the package and change the tag from verification-needed-mantic to verification-done-mantic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-mantic. 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 ubuntu-release-upgrader (Ubuntu Mantic):
status: Triaged → Fix Committed
tags: added: verification-needed verification-needed-mantic
Revision history for this message
Matt Coleman (mcoleman) wrote :
Changed in grub2 (Debian):
status: Confirmed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (5.4 KiB)

This bug was fixed in the package grub2 - 2.12~rc1-12ubuntu2

---------------
grub2 (2.12~rc1-12ubuntu2) noble; urgency=medium

  * Merge from Debian unstable; remaining changes:
    - Add Ubuntu sbat data
    - build-efi-images: do not produce -installer.efi.signed. LP: 1863994
    - grub-common: Install canonical-uefi-ca.crt
    - Check signatures
    - Support installing to multiple ESP (LP: 1871821)
    - Disable various bits on i386
    - Split out unsigned artefacts into grub2-unsigned
    - Vcs-Git: Point to ubuntu packaging branch
    - Relax dependencies on grub-common and grub2-common
    - grub-pc: Avoid the possibility of breaking grub on SRU update due
      to ABI change
    - UBUNTU: Default timeout changes
    - Revert "Add jfs module to signed UEFI images. Closes: #950959"
    - Revert "Add f2fs module to signed UEFI images"
    - Install grub-initrd-fallback.service again
    - Build using -O1 on s390x to avoid misoptimization
    - grub-check-signatures: Support gzip compressed kernels (LP: #1954683)
    - grub-multi-install: Reset partition type between partitions (LP: #1997795)
    - Drop i386 from grub-efi-amd64* (LP: #2020907)
    - Turn depends on grub-efi-amd64/arm64 unversioned
    - forward port fix for LP: #1926748
    - Make the grub2/no_efi_extra_removable setting work correctly
    - Forward port the fix for LP: #1930742 and make it conditional (xenial/bionic only)
    - Build grub2-unsigned packages with xz compression
    - Revert: "Have -bin packages Break pre-2.12 -signed packages.", this is not
      compatible with our versioning schemes.
    - Install a /usr/lib/grub/grub-sort-version and use that to sort versions as
      it respects GRUB_FLAVOUR_ORDER. Depend on python3 to do so.
    - rules: Add DPKG_BUILDPACKAGE_OPTIONS to generate-grub2-unsigned
    - Replaced patches:
      - installe-signed.patched
      - grub-install-extra-removable.patch
      - grub-install-removable-shim.patch
    - Added patches:
      + rhboot-f34-dont-use-int-for-efi-status.patch
      + rhboot-f34-make-exit-take-a-return-code.patch
      + suse-grub.texi-add-net_bootp6-document.patch
      + ubuntu-add-devicetree-command-support.patch
      + ubuntu-add-initrd-less-boot-fallback.patch
      + ubuntu-add-initrd-less-boot-messages.patch
      + ubuntu-boot-from-multipath-dependent-symlink.patch
      + ubuntu-dont-verify-loopback-images.patch
      + ubuntu-fix-lzma-decompressor-objcopy.patch
      + ubuntu-grub-install-extra-removable.patch
      + ubuntu-install-signed.patch
      + ubuntu-mkconfig-leave-breadcrumbs.patch
      + ubuntu-os-prober-auto.patch
      + ubuntu-recovery-dis_ucode_ldr.patch
      + ubuntu-resilient-boot-boot-order.patch
      + ubuntu-resilient-boot-ignore-alternative-esps.patch
      + ubuntu-shorter-version-info.patch
      + ubuntu-speed-zsys-history.patch
      + ubuntu-support-initrd-less-boot.patch
      + ubuntu-verifiers-last.patch
      + ubuntu-zfs-enhance-support.patch
      + ubuntu-zfs-gfxpayload-dynamic.patch
      + ubuntu-zfs-gfxpayload-keep-default.patch
      + ubuntu-zfs-insmod-xzio-and-lzopio-on-xen.patch
      + ubuntu-zfs-mkconfig-recovery-title.patch
      + ubuntu-zfs-mkco...

Read more...

Changed in grub2 (Ubuntu Noble):
status: Triaged → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-release-upgrader - 1:24.04.3

---------------
ubuntu-release-upgrader (1:24.04.3) noble; urgency=medium

  * DistUpgradeQuirk: do not use XFS /boot quirk for arm64 UEFI
  * Run pre-build.sh: updating po files, mirrors, and demotions.

 -- Nick Rosbrook <email address hidden> Sun, 05 Nov 2023 01:47:58 -0400

Changed in ubuntu-release-upgrader (Ubuntu Noble):
status: Triaged → Fix Released
Revision history for this message
Nick Rosbrook (enr0n) wrote :
Download full text (17.7 KiB)

I have verified this fix using ubuntu-release-upgrader 1:23.10.14 from mantic-proposed:

(1) On a BIOS system with XFS /boot partition:

ubuntu@ubuntu:~$ mount | grep /boot
/dev/sda1 on /boot type xfs (rw,relatime,attr2,inode64,logbufs=8,logbsize=32k,noquota)
ubuntu@ubuntu:~$ ls /sys/firmware/
acpi dmi memmap qemu_fw_cfg
ubuntu@ubuntu:~$ do-release-upgrade --proposed
Checking for a new Ubuntu release

= Welcome to Ubuntu 23.10 'Mantic Minotaur' =

The Ubuntu team is proud to announce Ubuntu 23.10 'Mantic Minotaur'.

To see what's new in this release, visit:
  https://wiki.ubuntu.com/ManticMinotaur/ReleaseNotes

Ubuntu is a Linux distribution for your desktop or server, with a fast
and easy install, regular releases, a tight selection of excellent
applications installed by default, and almost any other software you
can imagine available through the network.

We hope you enjoy Ubuntu.

== Feedback and Helping ==

If you would like to help shape Ubuntu, take a look at the list of
ways you can participate at

  http://www.ubuntu.com/community/participate/

Your comments, bug reports, patches and suggestions will help ensure
that our next release is the best release of Ubuntu ever. If you feel
that you have found a bug please read:

  http://help.ubuntu.com/community/ReportingBugs

Then report bugs using apport in Ubuntu. For example:

  ubuntu-bug linux

will open a bug report in Launchpad regarding the linux package.

If you have a question, or if you think you may have found a bug but
aren't sure, first try asking on the #ubuntu or #ubuntu-bugs IRC
channels on Libera.Chat, on the Ubuntu Users mailing list, or on the
Ubuntu forums:

  http://help.ubuntu.com/community/InternetRelayChat
  http://lists.ubuntu.com/mailman/listinfo/ubuntu-users
  http://www.ubuntuforums.org/

== More Information ==

You can find out more about Ubuntu on our website, IRC channel and wiki.
If you're new to Ubuntu, please visit:

  http://www.ubuntu.com/

To sign up for future Ubuntu announcements, please subscribe to Ubuntu's
very low volume announcement list at:

  http://lists.ubuntu.com/mailman/listinfo/ubuntu-announce

Continue [yN] y
Get:1 Upgrade tool signature [833 B]
Get:2 Upgrade tool [1,267 kB]
Fetched 1,268 kB in 0s (0 B/s)
authenticate 'mantic.tar.gz' against 'mantic.tar.gz.gpg'
extracting 'mantic.tar.gz'

Reading cache

Checking package manager
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Hit http://us.archive.ubuntu.com/ubuntu lunar InRelease
Hit http://us.archive.ubuntu.com/ubuntu lunar-updates InRelease
Hit http://us.archive.ubuntu.com/ubuntu lunar-backports InRelease
Hit http://us.archive.ubuntu.com/ubuntu lunar-security InRelease ...

tags: added: verification-done verification-done-mantic
removed: verification-needed verification-needed-mantic
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.