Source-Changes-HG archive

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

[src/netbsd-8]: src/sys/dev/ic Pull up following revision(s) (requested by sp...



details:   https://anonhg.NetBSD.org/src/rev/2ad3cb3b8927
branches:  netbsd-8
changeset: 850922:2ad3cb3b8927
user:      snj <snj%NetBSD.org@localhost>
date:      Wed Aug 09 05:18:26 2017 +0000

description:
Pull up following revision(s) (requested by spz in ticket #196):
        sys/dev/ic/ciss.c: revision 1.37
Reject negative indices from userland.

diffstat:

 sys/dev/ic/ciss.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (42 lines):

diff -r fa8ffbd40a3c -r 2ad3cb3b8927 sys/dev/ic/ciss.c
--- a/sys/dev/ic/ciss.c Wed Aug 09 05:17:03 2017 +0000
+++ b/sys/dev/ic/ciss.c Wed Aug 09 05:18:26 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ciss.c,v 1.36 2016/07/14 04:00:45 msaitoh Exp $        */
+/*     $NetBSD: ciss.c,v 1.36.10.1 2017/08/09 05:18:26 snj Exp $       */
 /*     $OpenBSD: ciss.c,v 1.68 2013/05/30 16:15:02 deraadt Exp $       */
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.36 2016/07/14 04:00:45 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.36.10.1 2017/08/09 05:18:26 snj Exp $");
 
 #include "bio.h"
 
@@ -1299,12 +1299,12 @@
                /* FALLTHROUGH */
        case BIOCDISK:
                bd = (struct bioc_disk *)addr;
-               if (bd->bd_volid > sc->maxunits) {
+               if (bd->bd_volid < 0 || bd->bd_volid > sc->maxunits) {
                        error = EINVAL;
                        break;
                }
                ldp = sc->sc_lds[0];
-               if (!ldp || (pd = bd->bd_diskid) > ldp->ndrives) {
+               if (!ldp || (pd = bd->bd_diskid) < 0 || pd > ldp->ndrives) {
                        error = EINVAL;
                        break;
                }
@@ -1405,7 +1405,7 @@
        int error = 0;
        u_int blks;
 
-       if (bv->bv_volid > sc->maxunits) {
+       if (bv->bv_volid < 0 || bv->bv_volid > sc->maxunits) {
                return EINVAL;
        }
        ldp = sc->sc_lds[bv->bv_volid];



Home | Main Index | Thread Index | Old Index