Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-2-1]: src/sys/dev/scsipi Pull up following revision(s) (requested...



details:   https://anonhg.NetBSD.org/src/rev/760c69cfe108
branches:  netbsd-2-1
changeset: 564114:760c69cfe108
user:      riz <riz%NetBSD.org@localhost>
date:      Thu Nov 03 20:24:30 2005 +0000

description:
Pull up following revision(s) (requested by bouyer in ticket #5961):
        sys/dev/scsipi/scsipi_ioctl.c: revision 1.54
Don't claim there is a data in or out phase if the datalen is 0 (userland
shouldn't claim it either, but a buggy software shouldn't be able to crash
the kernel anyway). Should fix port-sparc64/31925 by Johan A.van Zanten
(which should really be kern/31925).
Analysed and patch tested by Martin Husemann.

diffstat:

 sys/dev/scsipi/scsipi_ioctl.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (30 lines):

diff -r 01fe5e1ce70f -r 760c69cfe108 sys/dev/scsipi/scsipi_ioctl.c
--- a/sys/dev/scsipi/scsipi_ioctl.c     Mon Oct 31 21:01:09 2005 +0000
+++ b/sys/dev/scsipi/scsipi_ioctl.c     Thu Nov 03 20:24:30 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: scsipi_ioctl.c,v 1.46.4.1 2004/09/11 12:53:44 he Exp $ */
+/*     $NetBSD: scsipi_ioctl.c,v 1.46.4.1.4.1 2005/11/03 20:24:30 riz Exp $    */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -44,7 +44,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scsipi_ioctl.c,v 1.46.4.1 2004/09/11 12:53:44 he Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsipi_ioctl.c,v 1.46.4.1.4.1 2005/11/03 20:24:30 riz Exp $");
 
 #include "opt_compat_freebsd.h"
 #include "opt_compat_netbsd.h"
@@ -278,9 +278,9 @@
                goto bad;
        }
 
-       if (screq->flags & SCCMD_READ)
+       if ((screq->flags & SCCMD_READ) && screq->datalen > 0)
                flags |= XS_CTL_DATA_IN;
-       if (screq->flags & SCCMD_WRITE)
+       if ((screq->flags & SCCMD_WRITE) && screq->datalen > 0)
                flags |= XS_CTL_DATA_OUT;
        if (screq->flags & SCCMD_TARGET)
                flags |= XS_CTL_TARGET;



Home | Main Index | Thread Index | Old Index