On Wed, Jul 17, 2024 at 02:46:46PM +0800, Michael Chang via Grub-devel wrote: > The get_part_uuid() function made an assumption that the target grub > device is a partition device and accessed device->disk->partition > without checking for NULL. There are four situations where this > assumption is problematic: > > 1. The device is a net device instead of a disk. > 2. The device is an abstraction device, like LVM, RAID, or CRYPTO, which > is mostly logical "disk" ((lvmid/<UUID>) and so on). > 3. Firmware RAID may present the ESP to grub as an EFI disk (hd0) device > if it is contained within a Linux software RAID. > 4. When booting from a cdrom, the ESP is a vfat image indexed by the El > Torito boot catalog. The boot device is set to (cd0), corresponding > to the cdrom image mounted as an iso9660 filesystem. > > As a result, get_part_uuid() could lead to a NULL pointer dereference > and trigger a synchronous exception during boot if the ESP falls into > one of these categories. This patch fixes the problem by adding the > necessary checks to handle cases where the ESP is not a partition > device. > > Additionally, to avoid disrupting the boot process, this patch relaxes > the severity of the errors in this context to non-critical. Errors will > be logged, but they will not prevent the boot process from continuing. > > Fixes: e0fa7dc84 (bli: Add a module for the Boot Loader Interface) > Signed-off-by: Michael Chang <mch...@suse.com> > Reviewed-By: Oliver Steffen <ostef...@redhat.com>
Reviewed-by: Daniel Kiper <daniel.ki...@oracle.com> Daniel _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel