Module Name: src Committed By: bouyer Date: Sun Mar 20 21:20:06 UTC 2011
Modified Files: src/sys/kern [netbsd-5-0]: 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.2.2.2 -r1.376.4.2.2.3 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.2.2.2 src/sys/kern/vfs_syscalls.c:1.376.4.2.2.3 --- src/sys/kern/vfs_syscalls.c:1.376.4.2.2.2 Mon Dec 21 09:41:51 2009 +++ src/sys/kern/vfs_syscalls.c Sun Mar 20 21:20:06 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_syscalls.c,v 1.376.4.2.2.2 2009/12/21 09:41:51 sborrill Exp $ */ +/* $NetBSD: vfs_syscalls.c,v 1.376.4.2.2.3 2011/03/20 21:20:06 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.2.2.2 2009/12/21 09:41:51 sborrill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.376.4.2.2.3 2011/03/20 21:20:06 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));