Module Name: src
Committed By: bouyer
Date: Sun Mar 20 21:19:57 UTC 2011
Modified Files:
src/sys/kern [netbsd-5]: vfs_syscalls.c
Log Message:
Pull up following revision(s) (requested by dholland in ticket #1567):
sys/kern/vfs_syscalls.c: revision 1.415 via patch
Check for bogus flags to access() up front. Otherwise we end up
calling VOP_ACCESS with flags 0 and something asserts deep in the
bowels of kauth. PR 44648 from Taylor Campbell. (I moved the check
earlier relative to the suggested patch.)
Pullup candidate.
To generate a diff of this commit:
cvs rdiff -u -r1.376.4.5 -r1.376.4.6 src/sys/kern/vfs_syscalls.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/kern/vfs_syscalls.c
diff -u src/sys/kern/vfs_syscalls.c:1.376.4.5 src/sys/kern/vfs_syscalls.c:1.376.4.6
--- src/sys/kern/vfs_syscalls.c:1.376.4.5 Sun Feb 14 13:27:45 2010
+++ src/sys/kern/vfs_syscalls.c Sun Mar 20 21:19:57 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_syscalls.c,v 1.376.4.5 2010/02/14 13:27:45 bouyer Exp $ */
+/* $NetBSD: vfs_syscalls.c,v 1.376.4.6 2011/03/20 21:19:57 bouyer Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.376.4.5 2010/02/14 13:27:45 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.376.4.6 2011/03/20 21:19:57 bouyer Exp $");
#include "opt_compat_netbsd.h"
#include "opt_compat_43.h"
@@ -2390,6 +2390,11 @@
int error, flags;
struct nameidata nd;
+ if ((SCARG(uap, flags) & ~(R_OK | W_OK | X_OK)) != 0) {
+ /* nonsense flags */
+ return EINVAL;
+ }
+
cred = kauth_cred_dup(l->l_cred);
kauth_cred_seteuid(cred, kauth_cred_getuid(l->l_cred));
kauth_cred_setegid(cred, kauth_cred_getgid(l->l_cred));