Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/59cae1c3afee
branches:  netbsd-6-1
changeset: 776248:59cae1c3afee
user:      snj <snj%NetBSD.org@localhost>
date:      Sat Aug 19 04:29:12 2017 +0000

description:
Pull up following revision(s) (requested by mrg in ticket #1486):
        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 7fe2885f4639 -r 59cae1c3afee sys/dev/ic/ciss.c
--- a/sys/dev/ic/ciss.c Sat Aug 19 04:27:37 2017 +0000
+++ b/sys/dev/ic/ciss.c Sat Aug 19 04:29:12 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ciss.c,v 1.27.8.1 2012/11/22 17:24:52 riz Exp $        */
+/*     $NetBSD: ciss.c,v 1.27.8.1.2.1 2017/08/19 04:29:12 snj Exp $    */
 /*     $OpenBSD: ciss.c,v 1.14 2006/03/13 16:02:23 mickey Exp $        */
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.27.8.1 2012/11/22 17:24:52 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.27.8.1.2.1 2017/08/19 04:29:12 snj Exp $");
 
 #include "bio.h"
 
@@ -1198,12 +1198,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;
                }
@@ -1304,7 +1304,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