grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] bli: Fix crash in get_part_uuid


From: Daniel Kiper
Subject: Re: [PATCH v2] bli: Fix crash in get_part_uuid
Date: Tue, 13 Aug 2024 16:56:36 +0200
User-agent: NeoMutt/20170113 (1.7.2)

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 <mchang@suse.com>
> Reviewed-By: Oliver Steffen <osteffen@redhat.com>

Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Daniel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]