Bug in 2.0.36-pre6

Kurt Huwig (kurt@huwig.de)
Wed, 2 Sep 1998 18:07:51 +0200


-----BEGIN PGP SIGNED MESSAGE-----

Hi Alan!

Still something annoying (does not happen with 2.0.33, I just upgraded today):

divide error: 0000
CPU: 0
EIP: 0010:[partsize+187/284]
EFLAGS: 00010246
eax: 0002a57f ebx: 00000000 ecx: 00000000 edx: 00000000
esi: 0002a57f edi: 00000001 ebp: 00000000 esp: 015b4f00
ds: 0018 es: 0018 fs: 002b gs: 002b ss: 0018
Process fdisk (pid: 451, process nr: 9, stackpage=015b4000)
Stack: bffff824 00253a18 015b4f8c 0002a590 bffff824 0002a57f 015b4f8c 0002a590
00000001 00126518 00000000 00000000 001887e0 00253a18 0002a590 015b4f94
015b4f8c 015b4f90 bffff824 00188784 00004018 01d8bc00 01d8bc00 015b4f94
Call Trace: [bread+24/124] [scsicam_bios_param+92/196] [scsicam_bios_param+0/196] [sd_ioctl+251/804] [sys_ioctl+255/272] [system_call+85/128]
Code: f7 f3 0f af c7 01 c1 89 c8 0f af c3 89 c1 01 d9 39 74 24 2c

seems to be this one (drivers/scsi/scsicam.c)

ext_cyl= (logical_end-(end_head * end_sector + end_sector))
/(end_head + 1) / end_sector;

or at least this one

*cyls = capacity / ((end_head + 1) * end_sector);

'end_head' and 'end_sector' are unchecked.

Something like
- --- linux-pre-2.0.36-6/drivers/scsi/scsicam.c.orig Wed Sep 2 18:18:05 1998
+++ linux-pre-2.0.36-6/drivers/scsi/scsicam.c Wed Sep 2 18:19:45 1998
@@ -119,6 +119,8 @@
end_head = largest->end_head;
end_sector = largest->end_sector & 0x3f;

+ if( end_head + 1 == 0 || end_sector == 0 ) return -1;
+
#ifdef DEBUG
printk ("scsicam_bios_param : end at h = %d, c = %d, s = %d\n",
end_head, end_cyl, end_sector);

should do the job.

It happens while accessing a defective Syquest Disk (SCSI) with 'fdisk -l'.
Libc5, P75, 32MB RAM

Unfortunately, I cannot check my patch, because I don't have XS to the system
right now, but it seems resonable.

Kurt

- ---------------------------------------------------------------
Win-Installation: How often do YOU want to boot today?

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: noconv

iQBVAwUBNe1xHkcqiS0id3pJAQG6HAIAoBQrazTE8Z+zL8ziCHyJASKlA1O6gaVd
zbddQl/lZuWGiBmQSkY7RNzf6d5rNq9WZlBAPX1sIgv3PO3EWTKpEw==
=FYWd
-----END PGP SIGNATURE-----

-
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.altern.org/andrebalsa/doc/lkml-faq.html