Module Name: src Committed By: msaitoh Date: Fri Aug 8 03:14:02 UTC 2014
Modified Files: src/sys/compat/linux/common [netbsd-6-1]: linux_socketcall.c src/sys/compat/linux32/common [netbsd-6-1]: linux32_socketcall.c Log Message: 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@ To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.39.44.1 \ src/sys/compat/linux/common/linux_socketcall.c cvs rdiff -u -r1.7 -r1.7.28.1 \ src/sys/compat/linux32/common/linux32_socketcall.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/compat/linux/common/linux_socketcall.c diff -u src/sys/compat/linux/common/linux_socketcall.c:1.39 src/sys/compat/linux/common/linux_socketcall.c:1.39.44.1 --- src/sys/compat/linux/common/linux_socketcall.c:1.39 Thu Jul 3 14:07:09 2008 +++ src/sys/compat/linux/common/linux_socketcall.c Fri Aug 8 03:14:02 2014 @@ -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.44.1 2014/08/08 03:14:02 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.44.1 2014/08/08 03:14:02 msaitoh Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -123,7 +123,7 @@ linux_sys_socketcall(struct lwp *l, cons 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, Index: src/sys/compat/linux32/common/linux32_socketcall.c diff -u src/sys/compat/linux32/common/linux32_socketcall.c:1.7 src/sys/compat/linux32/common/linux32_socketcall.c:1.7.28.1 --- src/sys/compat/linux32/common/linux32_socketcall.c:1.7 Wed Nov 19 18:36:04 2008 +++ src/sys/compat/linux32/common/linux32_socketcall.c Fri Aug 8 03:14:02 2014 @@ -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.28.1 2014/08/08 03:14:02 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.28.1 2014/08/08 03:14:02 msaitoh Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -96,7 +96,7 @@ linux32_sys_socketcall(struct lwp *l, co 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,