All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: grub-probe gets a segfault
Date: Thu, 15 May 2008 18:45:52 -0400	[thread overview]
Message-ID: <1210891552.2360.35.camel@dv> (raw)
In-Reply-To: <200805120915.01236.isaacmarcos100010@gmail.com>

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	other threads:[~2008-05-15 22:46 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-08  9:24 grub-probe gets a segfault Isaac M. Marcos
2008-05-08 15:55 ` Pavel Roskin
2008-05-08 16:23   ` Isaac M. Marcos
2008-05-08 22:15     ` Pavel Roskin
2008-05-09 13:02       ` Robert Millan
2008-05-09 16:43         ` Isaac M. Marcos
2008-05-09 20:56           ` Pavel Roskin
2008-05-12 13:44             ` Isaac M. Marcos
2008-05-15 22:45               ` Pavel Roskin [this message]
2008-05-16 17:48                 ` Isaac Marcos
2008-05-16 18:02                   ` Pavel Roskin
2008-05-22  0:50                     ` Isaac M. Marcos
2008-05-22  1:06                       ` Pavel Roskin
2008-05-22 10:52                       ` Pavel Roskin
2008-05-24  0:10                         ` Isaac M. Marcos
2008-05-27 20:26                           ` Pavel Roskin
2008-05-28 13:36                         ` Robert Millan
2008-05-28 18:28                           ` Isaac M. Marcos
2008-05-30  3:59                             ` Pavel Roskin
2008-05-12 14:16       ` Isaac M. Marcos
2008-05-20 16:37         ` Jeff Chua
2008-05-20 19:53           ` Pavel Roskin
2008-05-21  2:22             ` Jeff Chua

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1210891552.2360.35.camel@dv \
    --to=proski@gnu.org \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.