grub-probe crashes with null pointer dereference in probe_raid_level

Bug #482542 reported by Chris Halse Rogers
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: grub2

This occurs on a machine which previously worked just fine. grub-pc is installed in the MBR of /dev/sda, which consists of a single partition with an LVM pv on there. /boot is on /, which is on the Ubuntu-Root lv. This worked fine.

I installed a second SATA disc, created a single partition, and added it to the Primary-Storage vg. Now, grub-probe segfaults when called with --target=abstraction, and the system fails to boot.

Tracing things back with gdb, this occurs because probe_raid_level on grub-probe.c:167 is called with list->disk, which is NULL. list->disk is NULL because grub_lvm_scan_device sets up the list of pvs associated with each vg, but only sets pv->disk for the device grub_lvm_scan_device was called on. Since I did not have /dev/sdb in /boot/grub/device.map, grub_lvm_scan_device is not called with the device containing this pv.

Upon adding an entry for /dev/sdb to /boot/grub/device.map grub-probe works, and grub boots the machine succesfully.

ProblemType: Bug
Architecture: amd64
Date: Sat Nov 14 19:11:24 2009
DistroRelease: Ubuntu 9.10
Package: grub-common 1.97~beta4-1ubuntu4
ProcEnviron:
 SHELL=/bin/zsh
 PATH=(custom, user)
 LANG=en_AU.UTF-8
ProcVersionSignature: Ubuntu 2.6.31-15.50-generic
SourcePackage: grub2
Uname: Linux 2.6.31-15-generic x86_64

Revision history for this message
Chris Halse Rogers (raof) wrote :
Revision history for this message
Colin Watson (cjwatson) wrote :

This is fixed now in Lucid. Here's the ChangeLog entry:

2010-01-20 Dan Merillat <email address hidden>

        * kern/device.c (grub_device_iterate): Allocate new part_ent
        structure based on sizeof (*p) rather than sizeof (p->next), to
        account for structure padding.

        * util/grub-probe.c (probe_raid_level): Return -1 immediately if
        disk is NULL, which might happen for LVM physical volumes with no
        LVM signature.

Changed in grub2 (Ubuntu):
status: New → Fix Released
Revision history for this message
Tommy_CZ (t-kijas) wrote :

same problem with MacbookAir2013 and Ubuntu 12.04.2.

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.