Subject: kern/763: scsi ioctl SCIOCCOMMAND will panic -current system
To: None <gnats-admin@NetBSD.ORG>
From: John Kohl <jtk@kolvir.blrc.ma.us>
List: netbsd-bugs
Date: 01/28/1995 22:20:04
>Number:         763
>Category:       kern
>Synopsis:       scsi ioctl SCIOCCOMMAND will panic -current system
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 28 22:20:03 1995
>Originator:     John Kohl
>Organization:
NetBSD Kernel Hackers `R` Us
>Release:        1.0A
>Environment:
	
System: NetBSD kolvir 1.0A NetBSD 1.0A (KOLVIR) #1: Sat Jan 28 18:32:10 EST 1995 jtk@kolvir:/u1/NetBSD-current/src/sys/arch/i386/compile/KOLVIR i386


>Description:
Using SCIOCCOMMAND on a -current kernel (i386) will cause a panic on a
DIAGNOSTIC kernel:
		panic("scsi_scsi_cmd: buffer without nosleep");

>How-To-Repeat:
Build a DIAGNOSTIC kernel.  Try to use SCIOCCOMMAND, watch it croak

>Fix:

--- 1.1	1995/01/28 23:31:02
+++ sys/scsi/scsi_ioctl.c	1995/01/28 23:31:37
@@ -240,7 +240,7 @@
 	error = scsi_scsi_cmd(sc_link, (struct scsi_generic *)screq->cmd,
 	    screq->cmdlen, (u_char *)bp->b_data, screq->datalen,
 	    0, /* user must do the retries *//* ignored */
-	    screq->timeout, bp, flags | SCSI_USER);
+	    screq->timeout, bp, flags | SCSI_USER | SCSI_NOSLEEP);
 
 	/* because there is a bp, scsi_scsi_cmd will return immediatly */
 	if (error)

>Audit-Trail:
>Unformatted: