[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] fix an infinite loop with a corrupted pc partition table
From: |
Robert Millan |
Subject: |
Re: [PATCH] fix an infinite loop with a corrupted pc partition table |
Date: |
Tue, 28 Jul 2009 19:55:14 +0200 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
On Sun, Jul 26, 2009 at 12:58:59AM +0200, Vladimir 'phcoder' Serbinenko wrote:
> + /* This is our loop-detection algorithm. It works the following way:
> + It saves last position which was a power of two. Then it compares the
> + saved value with a current one. This way it's guaranteed that the loop
> + will be broken by at most third walk.
> + */
> + if (lastaddr == p.offset)
> + return grub_error (GRUB_ERR_BAD_PART_TABLE, "loop detected");
> +
> + labeln++;
> + if (labeln == (lastlabeln << 1))
> + {
> + lastaddr = p.offset;
> + lastlabeln <<= 1;
> + }
I would prefer something simpler, but if that's not possible, this is better
than hardcoding a number IMO.
Unless Pavel has any objection, I think it's ok.
--
Robert Millan
The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
how) you may access your data; but nobody's threatening your freedom: we
still allow you to remove your data and not access it at all."
- Re: [PATCH] fix an infinite loop with a corrupted pc partition table, (continued)
- Re: [PATCH] fix an infinite loop with a corrupted pc partition table, Felix Zielcke, 2009/07/24
- Re: [PATCH] fix an infinite loop with a corrupted pc partition table, Pavel Roskin, 2009/07/24
- Re: [PATCH] fix an infinite loop with a corrupted pc partition table, Robert Millan, 2009/07/25
- Re: [PATCH] fix an infinite loop with a corrupted pc partition table, Vladimir 'phcoder' Serbinenko, 2009/07/25
- Re: [PATCH] fix an infinite loop with a corrupted pc partition table, Pavel Roskin, 2009/07/25
- Re: [PATCH] fix an infinite loop with a corrupted pc partition table, Vladimir 'phcoder' Serbinenko, 2009/07/25
- Re: [PATCH] fix an infinite loop with a corrupted pc partition table, Vladimir 'phcoder' Serbinenko, 2009/07/25
- Re: [PATCH] fix an infinite loop with a corrupted pc partition table, Vladimir 'phcoder' Serbinenko, 2009/07/25
- Re: [PATCH] fix an infinite loop with a corrupted pc partition table, Felix Zielcke, 2009/07/26
- Re: [PATCH] fix an infinite loop with a corrupted pc partition table,
Robert Millan <=
Re: [PATCH] fix an infinite loop with a corrupted pc partition table, Pavel Roskin, 2009/07/24