PERFORCE change 107365 for review

Todd Miller millert at FreeBSD.org
Fri Oct 6 10:52:54 PDT 2006


http://perforce.freebsd.org/chv.cgi?CH=107365

Change 107365 by millert at millert_g5tower on 2006/10/06 17:49:47

	Move mac_vnode_label_associate_file() to mac_vfs.c and hold
	the vnode lock around the call to mpo_vnode_label_associate_file.

Affected files ...

.. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_file.c#2 edit
.. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_vfs.c#11 edit

Differences ...

==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_file.c#2 (text+ko) ====

@@ -42,8 +42,6 @@
 #include <sys/systm.h>
 #include <sys/vnode.h>
 #include <sys/vnode_internal.h>
-#include <sys/mount.h>
-#include <sys/mount_internal.h>
 #include <sys/file.h>
 #include <sys/file_internal.h>
 #include <sys/sysctl.h>
@@ -265,12 +263,3 @@
 	MAC_CHECK(file_check_set, cred, fp, buf, buflen);
 	return (error);
 }
-
-void
-mac_vnode_label_associate_file(struct ucred *cred, struct fileproc *fp,
-    struct vnode *vp)
-{
-
-	MAC_PERFORM(vnode_label_associate_file, cred, fp, fp->f_label,
-	    vp, vp->v_label);
-}

==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_vfs.c#11 (text+ko) ====

@@ -43,6 +43,8 @@
 #include <sys/namei.h>
 #include <sys/mount.h>
 #include <sys/mount_internal.h>
+#include <sys/file.h>
+#include <sys/file_internal.h>
 #include <sys/uio_internal.h>
 
 #include <security/mac_internal.h>
@@ -1146,3 +1148,14 @@
 
 	return (0);
 }
+
+void
+mac_vnode_label_associate_file(struct ucred *cred, struct fileproc *fp,
+    struct vnode *vp)
+{
+
+	vnode_lock(vp);
+	MAC_PERFORM(vnode_label_associate_file, cred, fp, fp->f_label,
+	    vp, vp->v_label);
+	vnode_unlock(vp);
+}


More information about the trustedbsd-cvs mailing list