Mailing List Archive

problems with looped extended partitions
In file genhd.c at line 205 is eternal loop, which produce potential
problems when we have record in partition table, pointed at yourself. In this
case kernel hangs while booting.
All this work in stable and development kernels, and seems to be in
long awaited 2.2.0. :(
--
Alex Miller
asmm@usa.net
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Re: problems with looped extended partitions [ In reply to ]
From: Alex Miller <asm@som.kiev.ua>
In file genhd.c at line 205 is eternal loop, which produce potential
problems when we have record in partition table, pointed at yourself. In this
case kernel hangs while booting.
All this work in stable and development kernels, and seems to be in
long awaited 2.2.0. :(
Yes. Did you encounter this in real life?
Of course a fix would be trivial. Say
--- genhd.c~ Fri Jan 22 16:45:09 1999
+++ genhd.c Sat Jan 23 14:47:12 1999
@@ -189,6 +189,7 @@
*/

#define MSDOS_LABEL_MAGIC 0xAA55
+#define LOOPMAX 1000

static void extended_partition(struct gendisk *hd, kdev_t dev)
{
@@ -196,6 +197,7 @@
struct partition *p;
unsigned long first_sector, first_size, this_sector, this_size;
int mask = (1 << hd->minor_shift) - 1;
+ int loopct = 0;
int i;

first_sector = hd->part[MINOR(dev)].start_sect;
@@ -203,6 +205,8 @@
this_sector = first_sector;

while (1) {
+ if (++loopct >= LOOPMAX)
+ return;
if ((current_minor & mask) == 0)
return;
if (!(bh = bread(dev,0,get_ptable_blocksize(dev))))
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Re: problems with looped extended partitions [ In reply to ]
On Sat, 23 Jan 1999, Guest section DW wrote:
> In file genhd.c at line 205 is eternal loop, which produce potential
> problems when we have record in partition table, pointed at yourself. In this
> case kernel hangs while booting.
> All this work in stable and development kernels, and seems to be in
> long awaited 2.2.0. :(
>
> Yes. Did you encounter this in real life?
Of course, it was result of trojan software, which one of users runs on
his computer. I make patch, may be not so nice, but it worked.
> Of course a fix would be trivial. Say
Thanks!
But I think linux kernel must do _not_ hangs while booting in any
cases, ain't? btw - from DOS, OS/2, NT4 and Linux only NT don't catched
this trap.
--
Alex Miller
asmm@usa.net
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/