From: Pavel Roskin <proski@gnu.org>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] fix an infinite loop with a corrupted pc partition table
Date: Sat, 25 Jul 2009 18:06:16 -0400 [thread overview]
Message-ID: <1248559576.11389.33.camel@mj> (raw)
In-Reply-To: <d7ead6de0907250956j10e12acbl90c868c443bd6496@mail.gmail.com>
On Sat, 2009-07-25 at 18:56 +0200, Vladimir 'phcoder' Serbinenko wrote:
> On Sat, Jul 25, 2009 at 6:36 PM, Robert Millan<rmh@aybabtu.com> wrote:
> > On Fri, Jul 24, 2009 at 09:24:31PM +0200, Felix Zielcke wrote:
> >> + loop = 0;
> >> + while (loop < 100000)
> >> [...]
> >> + if (loop == 100000)
> >> + return grub_error (GRUB_ERR_BAD_PART_TABLE, "Corrupted partition table found.");
> >
> > What does this 100000 represent? It looks like heuristic, but I'm missing
> > some context (I'm not familiar with extended partition layout).
> It is a heuristic.It's a number bigger than highest number of "sane"
> partitions but an amount of iteration which a computer can handle
> easily.
> I know that it's an arbitrary limit butusing a correct algorithm (e.g.
> record all visited extended partitions offsets) would take place
> almost uselessly and other solutions risk to have other problems (as
> "invisible" partitions)
Let's try to see the complete picture. By the time we get 100000
partitions we are already in trouble, especially if running ls on a slow
terminal. Reaching 100000 means we were wrong all along.
Links backwards between extended partition entries are more likely to be
due to data corruption than due to buggy partitoning tools. OK, if you
want, let's support up to 10 backward links. That's more than enough.
I would hate to get caught in another discussion about minor issues when
we have a real problem in that code.
GRUB only follows a single chain of extended partitions rather than a
tree of links. I think the whole point in having the Linux extended
partition type is to allow it to coexist with an MS-DOS extended
partition. That's a realistic scenario, unlike backward links.
--
Regards,
Pavel Roskin
next prev parent reply other threads:[~2009-07-25 22:06 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-24 16:58 [PATCH] fix an infinite loop with a corrupted pc partition table Felix Zielcke
2009-07-24 19:24 ` Felix Zielcke
2009-07-24 20:28 ` Pavel Roskin
2009-07-24 20:46 ` Vladimir 'phcoder' Serbinenko
2009-07-25 16:36 ` Robert Millan
2009-07-25 16:56 ` Vladimir 'phcoder' Serbinenko
2009-07-25 22:06 ` Pavel Roskin [this message]
2009-07-25 22:35 ` Vladimir 'phcoder' Serbinenko
2009-07-25 22:58 ` Vladimir 'phcoder' Serbinenko
2009-07-25 23:20 ` Vladimir 'phcoder' Serbinenko
2009-07-26 6:49 ` Felix Zielcke
2009-07-28 17:55 ` Robert Millan
2009-08-23 15:40 ` Vladimir 'phcoder' Serbinenko
2009-08-28 17:30 ` Vladimir 'phcoder' Serbinenko
2009-09-11 21:50 ` Pavel Roskin
2009-07-24 19:56 ` Pavel Roskin
2009-07-24 20:35 ` Vladimir 'phcoder' Serbinenko
2009-07-24 21:03 ` Pavel Roskin
2009-07-25 10:48 ` Vladimir 'phcoder' Serbinenko
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=1248559576.11389.33.camel@mj \
--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.