Module Name:    src
Committed By:   snj
Date:           Wed Aug  9 05:17:03 UTC 2017

Modified Files:
        src/sys/dev/ic [netbsd-8]: isp_netbsd.c

Log Message:
Pull up following revision(s) (requested by spz in ticket #195):
        sys/dev/ic/isp_netbsd.c: revision 1.89
Reject out-of-bounds channel index.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.88.10.1 src/sys/dev/ic/isp_netbsd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/isp_netbsd.c
diff -u src/sys/dev/ic/isp_netbsd.c:1.88 src/sys/dev/ic/isp_netbsd.c:1.88.10.1
--- src/sys/dev/ic/isp_netbsd.c:1.88	Wed Dec 31 17:10:45 2014
+++ src/sys/dev/ic/isp_netbsd.c	Wed Aug  9 05:17:03 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: isp_netbsd.c,v 1.88 2014/12/31 17:10:45 christos Exp $ */
+/* $NetBSD: isp_netbsd.c,v 1.88.10.1 2017/08/09 05:17:03 snj Exp $ */
 /*
  * Platform (NetBSD) dependent common attachment code for Qlogic adapters.
  */
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: isp_netbsd.c,v 1.88 2014/12/31 17:10:45 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isp_netbsd.c,v 1.88.10.1 2017/08/09 05:17:03 snj Exp $");
 
 #include <dev/ic/isp_netbsd.h>
 #include <dev/ic/isp_ioctl.h>
@@ -475,6 +475,10 @@ ispioctl(struct scsipi_channel *chan, u_
 		}
 		lim = local.count;
 		channel = local.channel;
+		if (channel >= isp->isp_nchan) {
+			retval = EINVAL;
+			break;
+		}
 
 		ua = *(isp_dlist_t **)addr;
 		uptr = &ua->wwns[0];

Reply via email to