Source-Changes-HG archive

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

[src/netbsd-6]: src/sys/compat/netbsd32 Pull up revision 1.31, requested by m...



details:   https://anonhg.NetBSD.org/src/rev/9f6ae22ac90f
branches:  netbsd-6
changeset: 776821:9f6ae22ac90f
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Dec 14 13:59:08 2014 +0000

description:
Pull up revision 1.31, requested by maxv in #1209:

Prevent a user-triggerable kmem_alloc(0).

diffstat:

 sys/compat/netbsd32/netbsd32_compat_30.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 9be6bf482808 -r 9f6ae22ac90f sys/compat/netbsd32/netbsd32_compat_30.c
--- a/sys/compat/netbsd32/netbsd32_compat_30.c  Fri Dec 12 07:15:43 2014 +0000
+++ b/sys/compat/netbsd32/netbsd32_compat_30.c  Sun Dec 14 13:59:08 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_compat_30.c,v 1.30 2010/04/23 15:19:20 rmind Exp $    */
+/*     $NetBSD: netbsd32_compat_30.c,v 1.30.14.1 2014/12/14 13:59:08 martin Exp $      */
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_30.c,v 1.30 2010/04/23 15:19:20 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_30.c,v 1.30.14.1 2014/12/14 13:59:08 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -78,6 +78,9 @@
                error = EBADF;
                goto out;
        }
+       if (count == 0)
+               goto out;
+
        buf = kmem_alloc(count, KM_SLEEP);
        error = vn_readdir(fp, buf, UIO_SYSSPACE, count, &done, l, 0, 0);
        if (error == 0) {



Home | Main Index | Thread Index | Old Index