Source-Changes-HG archive

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

[src/netbsd-6-0]: src/sys/compat Pull up following revision(s) (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/40580d21c57c
branches:  netbsd-6-0
changeset: 774973:40580d21c57c
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Fri Aug 08 03:14:10 2014 +0000

description:
Pull up following revision(s) (requested by maxv in ticket #1104):
        sys/compat/linux32/common/linux32_socketcall.c: revision 1.9
        sys/compat/linux/common/linux_socketcall.c: revision 1.44
If SCARG(uap, what) = 0, copyin() will copy (size_t)-1 bytes, and it's not
a good idea; but not proven harmful.
With the help of njoly@

diffstat:

 sys/compat/linux/common/linux_socketcall.c     |  6 +++---
 sys/compat/linux32/common/linux32_socketcall.c |  6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diffs (54 lines):

diff -r 044353809b17 -r 40580d21c57c sys/compat/linux/common/linux_socketcall.c
--- a/sys/compat/linux/common/linux_socketcall.c        Thu Aug 07 10:00:09 2014 +0000
+++ b/sys/compat/linux/common/linux_socketcall.c        Fri Aug 08 03:14:10 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_socketcall.c,v 1.39 2008/07/03 14:07:09 njoly Exp $      */
+/*     $NetBSD: linux_socketcall.c,v 1.39.40.1 2014/08/08 03:14:10 msaitoh Exp $       */
 
 /*-
  * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_socketcall.c,v 1.39 2008/07/03 14:07:09 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_socketcall.c,v 1.39.40.1 2014/08/08 03:14:10 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -123,7 +123,7 @@
        struct linux_socketcall_dummy_args lda;
        int error;
 
-       if (SCARG(uap, what) < 0 || SCARG(uap, what) > LINUX_MAX_SOCKETCALL)
+       if (SCARG(uap, what) <= 0 || SCARG(uap, what) > LINUX_MAX_SOCKETCALL)
                return ENOSYS;
 
        if ((error = copyin(SCARG(uap, args), &lda,
diff -r 044353809b17 -r 40580d21c57c sys/compat/linux32/common/linux32_socketcall.c
--- a/sys/compat/linux32/common/linux32_socketcall.c    Thu Aug 07 10:00:09 2014 +0000
+++ b/sys/compat/linux32/common/linux32_socketcall.c    Fri Aug 08 03:14:10 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux32_socketcall.c,v 1.7 2008/11/19 18:36:04 ad Exp $ */
+/*     $NetBSD: linux32_socketcall.c,v 1.7.26.1 2014/08/08 03:14:10 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@@ -31,7 +31,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux32_socketcall.c,v 1.7 2008/11/19 18:36:04 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_socketcall.c,v 1.7.26.1 2014/08/08 03:14:10 msaitoh Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -96,7 +96,7 @@
        union linux32_socketcall_args ua;
        int error;
 
-       if (SCARG(uap, what) < 0 || SCARG(uap, what) > LINUX32_MAX_SOCKETCALL)
+       if (SCARG(uap, what) <= 0 || SCARG(uap, what) > LINUX32_MAX_SOCKETCALL)
                return ENOSYS;
 
        if ((error = copyin(SCARG_P32(uap, args), &ua,



Home | Main Index | Thread Index | Old Index