Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Oct 2006 17:50:48 GMT
From:      Todd Miller <millert@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 107365 for review
Message-ID:  <200610061750.k96HomX0065462@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=107365

Change 107365 by millert@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);
+}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200610061750.k96HomX0065462>