Module Name:    src
Committed By:   riastradh
Date:           Mon Oct 15 22:50:25 UTC 2012

Modified Files:
        src/external/cddl/osnet/sys/kern: policy.c

Log Message:
secpolicy_vnode_access must be called with the vnode lock held.

Don't unlock the vnode and then tell the caller about what the world
was like while the vnode was locked.  The world changes fast.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/cddl/osnet/sys/kern/policy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/cddl/osnet/sys/kern/policy.c
diff -u src/external/cddl/osnet/sys/kern/policy.c:1.2 src/external/cddl/osnet/sys/kern/policy.c:1.3
--- src/external/cddl/osnet/sys/kern/policy.c:1.2	Thu Jun 24 13:03:05 2010
+++ src/external/cddl/osnet/sys/kern/policy.c	Mon Oct 15 22:50:25 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: policy.c,v 1.2 2010/06/24 13:03:05 hannken Exp $	*/
+/*	$NetBSD: policy.c,v 1.3 2012/10/15 22:50:25 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -143,12 +143,10 @@ int
 secpolicy_vnode_access(kauth_cred_t cred, struct vnode *vp, uint64_t owner,
     int mode)
 {
-	int error;
 
-	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
-	error = VOP_ACCESS(vp, mode, cred);
-	VOP_UNLOCK(vp);
-	return error;
+	(void)owner;		/* XXX ignore? */
+	KASSERT(VOP_ISLOCKED(vp));
+	return VOP_ACCESS(vp, mode, cred);
 }
 
 /*

Reply via email to