grub-devel
[Top][All Lists]
Advanced

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

Re: Bug#632048: segfault in grub-setup


From: Stephane Chazelas
Subject: Re: Bug#632048: segfault in grub-setup
Date: Tue, 6 Sep 2011 11:45:59 +0100
User-agent: Mutt/1.5.16 (2007-09-19)

2011-09-06 09:18:57 +0100, Colin Watson:
> On Tue, Sep 06, 2011 at 08:39:24AM +0100, Stephane Chazelas wrote:
> > I do get a segfault as well when doing a grub-setup/grub-install
> > on a mdraid with 1.2 metadata.
> > 
> > The segv is in:
> > 
> > grub_util_biosdisk_is_floppy() because the disk->id for the root
> > device is not a bios disk id, but a big number that is the
> > "array id". The patch below seems to fix it for me, though I
> > can't tell it's the right fix or not (probably not).
> 
> This fix makes sense to me; calling grub_util_biosdisk_is_floppy on
> disks that aren't GRUB_DISK_DEVICE_BIOSDISK_ID doesn't make sense.
> grub-devel, second opinion?
> 
> > --- a/util/grub-setup.c     2011-09-05 12:11:31.864955442 +0100
> > +++ b/util/grub-setup.c     2011-09-05 13:00:24.891368760 +0100
> > @@ -315,7 +315,7 @@
> >      /* If DEST_DRIVE is a hard disk, enable the workaround, which is
> >         for buggy BIOSes which don't pass boot drive correctly. Instead,
> >         they pass 0x00 or 0x01 even when booted from 0x80.  */
> > -    if (!allow_floppy && !grub_util_biosdisk_is_floppy (dest_dev->disk))
> > +    if (!allow_floppy && dest_dev->disk->dev->id == 
> > GRUB_DISK_DEVICE_BIOSDISK_ID && !grub_util_biosdisk_is_floppy 
> > (dest_dev->disk))
> >        /* Replace the jmp (2 bytes) with double nop's.  */
> >        *boot_drive_check = 0x9090;
> >    }
[...]

The fact that the problem doesn't occur with mdraid-0.9 makes me
think the problem might be somewhere else though (like that
dest_dev->disk should be a biosdisk above)..

-- 
Stephane



reply via email to

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