Module Name:    src
Committed By:   njoly
Date:           Tue May 20 17:31:18 UTC 2014

Modified Files:
        src/sys/compat/linux/common: linux_uid16.c

Log Message:
Fix signed vs. unsigned comparison in getgroups16() syscall. Negative
gisetsize values now fail with EINVAL as expected.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/linux/common/linux_uid16.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_uid16.c
diff -u src/sys/compat/linux/common/linux_uid16.c:1.3 src/sys/compat/linux/common/linux_uid16.c:1.4
--- src/sys/compat/linux/common/linux_uid16.c:1.3	Tue May 20 15:48:24 2008
+++ src/sys/compat/linux/common/linux_uid16.c	Tue May 20 17:31:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_uid16.c,v 1.3 2008/05/20 15:48:24 njoly Exp $	*/
+/*	$NetBSD: linux_uid16.c,v 1.4 2014/05/20 17:31:18 njoly Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_uid16.c,v 1.3 2008/05/20 15:48:24 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_uid16.c,v 1.4 2014/05/20 17:31:18 njoly Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -241,7 +241,7 @@ linux_sys_getgroups16(struct lwp *l, con
 	*retval = ngrps;
 	if (SCARG(uap, gidsetsize) == 0)
 		return 0;
-	if (SCARG(uap, gidsetsize) < ngrps)
+	if (SCARG(uap, gidsetsize) < (int)ngrps)
 		return EINVAL;
 
 	gidset = SCARG(uap, gidset);

Reply via email to