grub-devel
[Top][All Lists]
Advanced

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

Re: grub-probe gets a segfault


From: Pavel Roskin
Subject: Re: grub-probe gets a segfault
Date: Thu, 15 May 2008 18:45:52 -0400

On Mon, 2008-05-12 at 09:14 -0430, Isaac M. Marcos wrote:

> (gdb) print mda_size
> $1 = 192512
> 
> not what you though :-(

OK, we have something interesting here.  mda_size is 192512 (0x2f000).
rlocn->offset is 92672 (0x16a00).  But (q - metadatabuf) is 325120
(0x4f600).  So, the initial value of q was within the buffer, but the
value that caused the segfault was outside the buffer.

It means that GRUB could not find any space character in the buffer and
kept scanning until it hit unallocated space.  I believe it's not valid
LVM metadata.

> $ sudo pvck /dev/sda6
>   Device /dev/sda6 not found (or ignored by filtering).

So, it's not a LVM physical volume.

> /dev/sda6            3397        6561    25422831   fd  Linux raid autodetect

It's a RAID partition.  I guess RAID partitions have a different layout.

The fix would be to reject RAID partitions in grub_lvm_scan_device().
The only validity check in that function is presence of the LVM label in
the first 4 sectors.  Perhaps additional checks are needed.

-- 
Regards,
Pavel Roskin




reply via email to

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