grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] biosdisk / open_device() messing up offsets


From: Pavel Roskin
Subject: Re: [PATCH] biosdisk / open_device() messing up offsets
Date: Fri, 06 Jun 2008 18:53:52 -0400

On Fri, 2008-06-06 at 17:56 +0200, Robert Millan wrote:
> Committed.

I believe it's wrong.  util/biosdisk.c is a low level disk driver.  It's
supposed to read data relative to the disk, like other drivers do.

Besides, is_partition becomes write-only.  It means that the result of
linux_find_partition() is ignored.  Please note that
linux_find_partition() modifies its first argument on success.  It
rewrites the disk device (e.g. /dev/sda) with the partition device
(e.g. /dev/sda1).

If the result of linux_find_partition() is not checked, nobody knows
whether fd is a handle to the partition or to the whole disk.  Yet the
sector variable is used to seek on that device.  Needless to say that
different values would be obtained.

Also, grub-emu is not the only user of util/biosdisk.c.  It is also used
by grub-setup, which is working correctly,  as far as I can tell.

By the way, the current GRUB just failed to install on my test system.
After I rebooted it, GRUB hung on startup after showing "GRUB".

It may be something else.  It was an unclean reboot after a panic for
unrelated reasons, so the hanging problem may be an issue with ext3.
Anyway, extreme caution is required with the current code!

-- 
Regards,
Pavel Roskin




reply via email to

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