From miff@spam.frisbee.net.au  Mon Jan 15 04:48:27 1996
Received: from lovely.spam.frisbee.net.au (spam.apana.org.au [202.0.75.1])
          by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id EAA11414
          for <FreeBSD-gnats-submit@freebsd.org>; Mon, 15 Jan 1996 04:48:23 -0800 (PST)
Received: (from miff@localhost) by lovely.spam.frisbee.net.au (8.6.12/8.6.12) id XAA20113; Mon, 15 Jan 1996 23:28:31 +1030
Message-Id: <199601151258.XAA20113@lovely.spam.frisbee.net.au>
Date: Mon, 15 Jan 1996 23:28:31 +1030
From: miff@spam.frisbee.net.au
Reply-To: miff@spam.frisbee.net.au
To: FreeBSD-gnats-submit@freebsd.org
Subject: divide-by-zero in kernel on bad disk info
X-Send-Pr-Version: 3.2

>Number:         946
>Category:       kern
>Synopsis:       divide-by-zero in kernel on bad disk info
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 15 04:50:01 PST 1996
>Closed-Date:    Sat Apr 19 07:56:10 PDT 1997
>Last-Modified:  Sat Apr 19 07:57:05 PDT 1997
>Originator:     michael smith
>Release:        FreeBSD 2.1-STABLE i386
>Organization:
Just me.
>Environment:

	A disk controller that reports zero for sectors-per-track
	(only observed with the 'wd' driver)

>Description:

	correct_readdisklabel() (ufs/ufs_disksubr.c) doesn't check 
	lp->d_secpercyl before dividing by it, and the error isn't 
	picked up in the wd driver before this point.
	(The same problem is present in -current)

>How-To-Repeat:

	Find a controller combination (in this case, an Adaptec 2320D)
	that results in s/t being zero.
	Power the controller up without having any disks enabled in the
	BIOS.  The controller appears not to check the geometry of its
	disks on reset. (boot probe shows 306/4/0)
	Say 'disklabel <disk>'.

>Fix:
	
	Check d_secpercyl at some point prior to dividing, or perhaps
	reject bogus disks out of hand.



>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: scrappy 
State-Changed-When: Mon Oct 21 23:32:50 PDT 1996 
State-Changed-Why:  

Dust off the cobwebs - Confirm Status 
State-Changed-From-To: feedback->closed 
State-Changed-By: scrappy 
State-Changed-When: Sat Apr 19 07:56:10 PDT 1997 
State-Changed-Why:  

Fixed in Revision 1.25 of src/sys/i386/isa/diskslice_machdep.c 

Closed by request of Michael Smith <msmith@atrad.adelaide.edu.au> 
>Unformatted:
