Bug#1064945: grub-efi-amd64: Sudden boot failures on ZFS systems

Julian Andres Klode julian.klode at canonical.com
Wed Feb 28 09:28:25 GMT 2024


Control: severity -1 normal
Control: tag -1 - patch

On Tue, Feb 27, 2024 at 10:36:01PM -0600, John Goerzen wrote:
> Package: grub-efi-amd64
> Version: 2.06-13+deb12u1
> Severity: critical
> Tags: upstream patch
> Justification: breaks the whole system
> 
> My system suddenly refused to start up grub.  An error message flashed by, but
> too quickly for me to be able to see.  Then I got the grub emergency prompt.
> 
> Upon booting from a Debian live image to attempt to fix this, after chrooting
> into an appropriately-configured filesystem from the target (with bind-mount
> /proc, /sys, /dev, /boot/efi, etc), grub-install failed with:
> 
> error: compression algorithm inherit not supported
> 
> I'll note that "inherit" is not really a compression algorithm for ZFS.  (root,
> and also boot, are part of ZFS on this system.)
> 
> Upon researching this, I see that https://github.com/openzfs/zfs/issues/15261
> discusses the problem.  https://github.com/openzfs/zfs/issues/13873 does as
> well.
> 
> https://github.com/openzfs/zfs/issues/13873#issuecomment-1905182760 suggests
> that it is the ZFS feature extensible_dataset that is responsible for this.
> That feature can get auto-enabled by other features at runtime.

My understanding is that this happens when snapshots are used on /boot which
as you can see is not a supported configuration.

Also note that zfs on /boot is one of the file systems we are looking at
phasing out for a future Debian release because it is overly complex for
the use case and hence a significant risk factor for secure boot.

> 
> Both of these bugs indicate that grub 2.12 contains patches to fix the issue.
> Indeed, the four patches listed at
> https://git.savannah.gnu.org/cgit/grub.git/log/grub-core/fs/zfs/zfs.c pertaining
> to ZFS are thought to fix it.

I don't know who started that rumour, but that is a lie, there are 12 patches,
not 4, between 2.06 and 2.12

$ git shortlog grub-2.06..grub-2.12 grub-core/fs/zfs/
Darren Kenny (1):
      fs/zfs/zfs: Fix possible insecure use of chunk size in zap_leaf_array_get()

Elyes Haouas (1):
      fs: Remove trailing whitespaces

Glenn Washburn (1):
      zfs: Use grub_uint64_t instead of 1ULL in BF64_*CODE() macros

Jagannathan Raman (4):
      fs/zfs/zfs: make_mdn() - avoid pointer downcasting
      fs/zfs/zfs: zfs_mount() - avoid pointer downcasting
      fs/zfs/zfs: Pass pointer to dnode_end_t instead of value to fill_fs_info()
      fs/zfs/zfs: Update dangling dn_new pointer in dnode_get_path()

Vladimir 'phcoder' Serbinenko (1):
      Revert "zfsinfo: Correct a check for error allocating memory"

Vladimir Serbinenko (4):
      ZFS: support inode type embed into its ID
      ZFS: Fix invalid memcmp
      ZFS: Don't iterate over null objsets
      ZFS: Check bonustype in addition to dnode type


> 
> I have built a bookworm-backports version of grub 2.12 and it does indeed solve
> the problem.
> 
> I think this issue justifies backporting those ZFS patches into the version in
> bookworm for stable-proposed-updates.

Patches welcome. I'm not sure you can pick a subset, but it's worth trying.


-- 
debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer                              i speak de, en



More information about the Pkg-grub-devel mailing list