diff options
| author | maxv <maxv@NetBSD.org> | 2014-06-21 10:23:07 +0000 |
|---|---|---|
| committer | maxv <maxv@NetBSD.org> | 2014-06-21 10:23:07 +0000 |
| commit | 64673a6c31ccede36d85a490c1adcaab48b1cfc2 (patch) | |
| tree | bb76eec75b2655aff283a13d4f1df06bd62ee79d /sys/compat/linux/common/linux_socketcall.c | |
| parent | 87297db6f323ab91e4a258c3c568ac1e7c13e32c (diff) | |
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 (limited to 'sys/compat/linux/common/linux_socketcall.c')
| -rw-r--r-- | sys/compat/linux/common/linux_socketcall.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/compat/linux/common/linux_socketcall.c b/sys/compat/linux/common/linux_socketcall.c index 96e20262bc4..a4ac9c38103 100644 --- a/sys/compat/linux/common/linux_socketcall.c +++ b/sys/compat/linux/common/linux_socketcall.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_socketcall.c,v 1.43 2013/12/27 15:10:53 njoly Exp $ */ +/* $NetBSD: linux_socketcall.c,v 1.44 2014/06/21 10:23:07 maxv 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.43 2013/12/27 15:10:53 njoly Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_socketcall.c,v 1.44 2014/06/21 10:23:07 maxv Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -125,7 +125,7 @@ linux_sys_socketcall(struct lwp *l, const struct linux_sys_socketcall_args *uap, 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, |
