GRUB segfaults on amd64

Bug #12459 reported by Matt Zimmerman
10
Affects Status Importance Assigned to Milestone
grub (Ubuntu)
Fix Released
Critical
Colin Watson

Bug Description

I attempted a Hoary install on the usual amd64 test system, which failed to boot
the second stage due to the "GRUB Hard Disk Error" condition. It seemed similar
to the condition described in bug #9705, but after booting the CD and chrooting
for a second attempt, I noticed grub segfaulting. The messages indicate that an
xfs_freeze segfault might be "normal" here, but certainly not a grub segfault.

Warty has been installed on the same system many times without difficulty, so
this is a regression.

--- output ---
Due to a bug in xfs_freeze, the following command might produce a segmentation
fault when /boot/grub is not in an XFS filesystem. This error is harmless and
can be ignored.
xfs_freeze: specified file ["/boot/grub"] is not on an XFS filesystem
/sbin/grub-install: line 516: 19032 Segmentation fault $grub_shell --batch
$no_floppy --device-map=$device_map >$log_file <<EOF
root $root_drive
setup $force_lba --stage2=$grubdir/stage2 --prefix=$grub_prefix $install_drive
quit
EOF

Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

(hd0) /dev/hda
--- output ---

It is also quite disturbing that grub-install chooses to continue in this case,
without issuing an error. It seems quite likely in this case that the grub
installation process did not complete, and this should have resulted in an error
being passed all the way back up to the installer.

Revision history for this message
Colin Watson (cjwatson) wrote :

Yes, this is the bug I've been talking to Fabio and others about on IRC for the
last week or so. See:

  http://www.ussg.iu.edu/hypermail/linux/kernel/0501.3/1083.html

Revision history for this message
Colin Watson (cjwatson) wrote :

Created an attachment (id=1263)
fix noexec= parameter handling on amd64

Fabio, please apply the attached kernel patch; it fixes the noexec= boot option
on amd64 to actually work when other options come after it (as invariably
happens when booting from a CD using syslinux). Once this is applied, we can
set the CD to boot with noexec=off as a temporary workaround.

Revision history for this message
Colin Watson (cjwatson) wrote :

Oh, it would be nice to get this in RSN so that I can do Array CD 4 tomorrow, if
possible. :-)

Revision history for this message
Fabio Massimo Di Nitto (fabbione) wrote :

Colin where did you grab this patch? I find strange the use of memcmp, since
all over the kernel the functions to handle __setup use strncmp().
In anycase i cannot upload the kernel with this patch anytime soon.
It changes the ABI (for a very important fix) and that means the usual
dance kernel -> l-r-m -> d-i & co.

Revision history for this message
Colin Watson (cjwatson) wrote :

(In reply to comment #4)
> Colin where did you grab this patch? I find strange the use of memcmp, since
> all over the kernel the functions to handle __setup use strncmp().

I wrote it myself, which probably explains it :-) I used memcmp() because
arch/x86_64/kernel/setup.c:parse_cmdline_early() uses it, but I don't care if it
becomes strncmp() instead.

Revision history for this message
Colin Watson (cjwatson) wrote :

Turns out, thanks to Andi Kleen, that this was really a grub issue. Fixed, and
patch sent to Debian:

grub (0.95+cvs20040624-12ubuntu2) hoary; urgency=low

  * patches/mprotect.diff: New. Make simulated stack executable, fixing
    segfaults with Linux 2.6.10 on systems with a hardware NX bit.

 -- Colin Watson <email address hidden> Sat, 5 Feb 2005 10:27:27 +0000

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.