Re: Bad partition table causes crash.

Guest section DW (dwguest@win.tue.nl)
Thu, 12 Nov 1998 21:35:06 +0100 (MET)


From: Stanislav Brabec <utx@k332.feld.cvut.cz>
Subject: Bad partition table causes crash.

I have tried to mount ZIP disk with mangled (nonexisting) partition table.
Linux had frozen.

On my opinion the problem is in partition table validity check.

Hmm, let us see. Your table contains the aa55 magic, so is accepted
as a valid partition table. It says

------------------------------------------------------------
# sfdisk -l -uS y
Units = sectors of 512 bytes, counting from 0

Device Boot Start End #sectors Id System
y1 ? 1919950958 2464388050 544437093 20 Unknown
y2 ? 1330184202 1869160489 538976288 6b Unknown
y3 ? 538989391 1937352302 1398362912 53 DM6 Aux3
y4 * 1394627663 1394648999 21337 49 Unknown
------------------------------------------------------------

So you try to mount some partition, say the first, and the
kernel tries to read sector 1919950958 or so,
and your ZIP disk did not have so many sectors.

I have heard people complain about this before, and of course
one could invent some heuristics about properties of partition
tables that would have caught this, but the real problem here
is just that the kernel tries to read a nonexistent sector.

For the time being I regard this as a bug in the IDE (or SCSI)
code: when an I/O request comes down to the driver it should
check the sector number.

You were fortunate that the garbage Id's differed from those
for extended partitions, otherwise the kernel would have crashed
at boot time, instead of at the moment you gave the mount command.

Andries

[P.S. Of course a "dd if=/dev/zero of=yourzipdisk bs=512 count=1"
will fix your problem with this disk.]

-
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/