grub-devel
[Top][All Lists]
Advanced

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

Re: [Patch] Discard incorrect nested partitions (fixes #29956)


From: Grégoire Sutre
Subject: Re: [Patch] Discard incorrect nested partitions (fixes #29956)
Date: Fri, 09 Jul 2010 12:53:30 +0200
User-agent: Mozilla/5.0 (X11; U; NetBSD i386; en-US; rv:1.9.1.9) Gecko/20100603 Shredder/3.0.4

On 07/08/2010 02:28, Vladimir 'φ-coder/phcoder' Serbinenko wrote:

Attached is the new version of the patch.

As I already told you in real dprintf isn't seen by user. One need to
grub_dprintf (....);
#ifdef GRUB_UTIL
grub_util_warn (...);
#endif

Ok.  For partition.c, this is now done in the checking function to avoid
code duplication (and it makes the code easier to read).

For bsdlabel.c, I re-ordered the code so that no warning is shown for
partitions of type unused (such as the raw partition).

I simplified the check in grub_disk_adjust_range: no need to check for
the ``ancestor'' partitions, but we still check for the given partition.

You're right. This means we can't screw this test to save space. In this
case it's better to do the complete check for early bug catch.

I removed the simplification from the patch.

We shouldn't check for partitions being outside of disk since BIOS disk
size limitations are common. Consider following situation:
(hd0,msdos1,bsd1)           /boot
BIOS LIMIT
(hd0,msdos1,bsd2)          /
This system is perfectly capable of booting but with your patch it won't.

Right.  The patch now only checks sub-partitions (no check is done on
top-level partitions).

> We must always exercice best effort strategy. If something can bee
> booted, boot it.

Here, we discard improperly nested partitions, even though they could
be accessed.  So one may argue that this breaks the best effort
strategy.  However, such improperly nested partitions can in general be
accessed by a properly nested identifier, so I guess it's fine.

We should warn if a used final-nestedness partition is partialy outside
the limit. Simple message usually scrolls way too fast and so usually
ignored (if someone sees boot process at all). Perhaps we need a way to
pass such warnings to kernel which then can take appropriate action
(e.g. notify sysadmin)

I'm not sure where we should check that.  If one attempts to load a
kernel or module that is beyond the disk limit, grub_disk_read will
fail anyway.

Grégoire

Attachment: strict-partition-nesting_v3.diff
Description: Text document


reply via email to

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