Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Jan 2008 02:19:02 GMT
From:      Zhouyi ZHOU <zhouzhouyi@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 133906 for review
Message-ID:  <200801230219.m0N2J2dd095033@repoman.freebsd.org>

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

Change 133906 by zhouzhouyi@zhouzhouyi_mactest on 2008/01/23 02:18:02

	IFC adapt rookie's vnode lock change  

Affected files ...

.. //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/audit/audit.c#6 integrate
.. //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/audit/audit.h#5 integrate
.. //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/audit/audit_arg.c#5 integrate
.. //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/audit/audit_bsm.c#6 integrate
.. //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/audit/audit_bsm_klib.c#5 integrate
.. //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/audit/audit_bsm_token.c#4 integrate
.. //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/audit/audit_ioctl.h#3 integrate
.. //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/audit/audit_pipe.c#6 integrate
.. //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/audit/audit_private.h#3 integrate
.. //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/audit/audit_syscalls.c#6 integrate
.. //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/audit/audit_trigger.c#3 integrate
.. //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/audit/audit_worker.c#4 integrate
.. //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/mac/mac_policy.h#9 edit
.. //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/mac/mac_process.c#5 integrate
.. //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/mac/mac_syscalls.c#6 integrate
.. //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/mac_test/mac_test_log.c#10 edit

Differences ...

==== //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/audit/audit.c#6 (text) ====


==== //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/audit/audit.h#5 (text) ====


==== //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/audit/audit_arg.c#5 (text) ====

@@ -26,7 +26,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/security/audit/audit_arg.c,v 1.15 2007/06/27 17:01:14 csjp Exp $
+ * $FreeBSD: src/sys/security/audit/audit_arg.c,v 1.17 2008/01/13 14:44:13 attilio Exp $
  */
 
 #include <sys/param.h>
@@ -630,9 +630,9 @@
 		 */
 		vp = fp->f_vnode;
 		vfslocked = VFS_LOCK_GIANT(vp->v_mount);
-		vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curthread);
+		vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
 		audit_arg_vnode(vp, ARG_VNODE1);
-		VOP_UNLOCK(vp, 0, curthread);
+		VOP_UNLOCK(vp, 0);
 		VFS_UNLOCK_GIANT(vfslocked);
 		break;
 
@@ -848,9 +848,9 @@
 
 	vp = fp->f_vnode;
 	vfslocked = VFS_LOCK_GIANT(vp->v_mount);
-	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
+	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
 	audit_arg_vnode(vp, ARG_VNODE1);
-	VOP_UNLOCK(vp, 0, td);
+	VOP_UNLOCK(vp, 0);
 	VFS_UNLOCK_GIANT(vfslocked);
 	fdrop(fp, td);
 }

==== //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/audit/audit_bsm.c#6 (text) ====

@@ -26,7 +26,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/security/audit/audit_bsm.c,v 1.22 2007/10/26 01:23:07 csjp Exp $
+ * $FreeBSD: src/sys/security/audit/audit_bsm.c,v 1.24 2008/01/18 19:57:21 csjp Exp $
  */
 
 #include <sys/param.h>
@@ -429,6 +429,7 @@
 	switch(ar->ar_event) {
 	case AUE_ACCEPT:
 	case AUE_BIND:
+	case AUE_LISTEN:
 	case AUE_CONNECT:
 	case AUE_RECV:
 	case AUE_RECVFROM:
@@ -1191,7 +1192,8 @@
 		if (ARG_IS_VALID(kar, ARG_GROUPSET)) {
 			for(ctr = 0; ctr < ar->ar_arg_groups.gidset_size; ctr++)
 			{
-				tok = au_to_arg32(1, "setgroups", 							ar->ar_arg_groups.gidset[ctr]);
+				tok = au_to_arg32(1, "setgroups",
+				    ar->ar_arg_groups.gidset[ctr]);
 				kau_write(rec, tok);
 			}
 		}

==== //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/audit/audit_bsm_klib.c#5 (text) ====

@@ -27,7 +27,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/security/audit/audit_bsm_klib.c,v 1.8 2007/10/29 18:07:48 rwatson Exp $
+ * $FreeBSD: src/sys/security/audit/audit_bsm_klib.c,v 1.9 2008/01/10 01:10:55 attilio Exp $
  */
 
 #include <sys/param.h>
@@ -526,7 +526,7 @@
 		 * attention.
 		 */
 		vfslocked = VFS_LOCK_GIANT(vnp->v_mount);
-		vn_lock(vnp, LK_EXCLUSIVE | LK_RETRY, td);
+		vn_lock(vnp, LK_EXCLUSIVE | LK_RETRY);
 		error = vn_fullpath(td, vnp, &retbuf, &freebuf);
 		if (error == 0) {
 			/* Copy and free buffer allocated by vn_fullpath().

==== //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/audit/audit_bsm_token.c#4 (text) ====


==== //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/audit/audit_ioctl.h#3 (text) ====


==== //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/audit/audit_pipe.c#6 (text) ====


==== //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/audit/audit_private.h#3 (text) ====


==== //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/audit/audit_syscalls.c#6 (text) ====

@@ -26,7 +26,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/security/audit/audit_syscalls.c,v 1.22 2007/10/24 19:04:00 rwatson Exp $
+ * $FreeBSD: src/sys/security/audit/audit_syscalls.c,v 1.23 2008/01/13 14:44:13 attilio Exp $
  */
 
 #include "opt_mac.h"
@@ -656,14 +656,14 @@
 	vp = nd.ni_vp;
 #ifdef MAC
 	error = mac_system_check_auditctl(td->td_ucred, vp);
-	VOP_UNLOCK(vp, 0, td);
+	VOP_UNLOCK(vp, 0);
 	if (error) {
 		vn_close(vp, AUDIT_CLOSE_FLAGS, td->td_ucred, td);
 		VFS_UNLOCK_GIANT(vfslocked);
 		return (error);
 	}
 #else
-	VOP_UNLOCK(vp, 0, td);
+	VOP_UNLOCK(vp, 0);
 #endif
 	NDFREE(&nd, NDF_ONLY_PNBUF);
 	if (vp->v_type != VREG) {

==== //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/audit/audit_trigger.c#3 (text) ====


==== //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/audit/audit_worker.c#4 (text) ====

@@ -27,7 +27,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/security/audit/audit_worker.c,v 1.17 2007/10/20 23:23:22 julian Exp $
+ * $FreeBSD: src/sys/security/audit/audit_worker.c,v 1.19 2008/01/13 14:44:13 attilio Exp $
  */
 
 #include <sys/param.h>
@@ -136,9 +136,9 @@
 	error = VFS_STATFS(vp->v_mount, mnt_stat, td);
 	if (error)
 		goto fail;
-	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
+	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
 	error = VOP_GETATTR(vp, &vattr, cred, td);
-	VOP_UNLOCK(vp, 0, td);
+	VOP_UNLOCK(vp, 0);
 	if (error)
 		goto fail;
 	audit_fstat.af_currsz = vattr.va_size;
@@ -251,9 +251,9 @@
 	 */
 	if (audit_in_failure) {
 		if (audit_q_len == 0 && audit_pre_q_len == 0) {
-			VOP_LOCK(vp, LK_DRAIN | LK_INTERLOCK, td);
+			VOP_LOCK(vp, LK_DRAIN | LK_INTERLOCK);
 			(void)VOP_FSYNC(vp, MNT_WAIT, td);
-			VOP_UNLOCK(vp, 0, td);
+			VOP_UNLOCK(vp, 0);
 			panic("Audit store overflow; record queue drained.");
 		}
 	}
@@ -268,9 +268,9 @@
 	 * space, or ENOSPC returned by the vnode write call.
 	 */
 	if (audit_fail_stop) {
-		VOP_LOCK(vp, LK_DRAIN | LK_INTERLOCK, td);
+		VOP_LOCK(vp, LK_DRAIN | LK_INTERLOCK);
 		(void)VOP_FSYNC(vp, MNT_WAIT, td);
-		VOP_UNLOCK(vp, 0, td);
+		VOP_UNLOCK(vp, 0);
 		panic("Audit log space exhausted and fail-stop set.");
 	}
 	(void)send_trigger(AUDIT_TRIGGER_NO_SPACE);
@@ -283,9 +283,9 @@
 	 * lost, which may require an immediate system halt.
 	 */
 	if (audit_panic_on_write_fail) {
-		VOP_LOCK(vp, LK_DRAIN | LK_INTERLOCK, td);
+		VOP_LOCK(vp, LK_DRAIN | LK_INTERLOCK);
 		(void)VOP_FSYNC(vp, MNT_WAIT, td);
-		VOP_UNLOCK(vp, 0, td);
+		VOP_UNLOCK(vp, 0);
 		panic("audit_worker: write error %d\n", error);
 	} else if (ppsratecheck(&last_fail, &cur_fail, 1))
 		printf("audit_worker: write error %d\n", error);

==== //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/mac/mac_policy.h#9 (text+ko) ====

@@ -670,6 +670,7 @@
 	mpo_devfs_create_symlink_t		mpo_devfs_create_symlink;
 	mpo_devfs_destroy_label_t		mpo_devfs_destroy_label;
 	mpo_devfs_init_label_t			mpo_devfs_init_label;
+	mpo_devfs_init_label_t			mpo_mactest_init_label;
 	mpo_devfs_update_t			mpo_devfs_update;
 	mpo_devfs_vnode_associate_t		mpo_devfs_vnode_associate;
 

==== //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/mac/mac_process.c#5 (text+ko) ====

@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/security/mac/mac_process.c,v 1.120 2007/10/25 12:34:13 rwatson Exp $");
+__FBSDID("$FreeBSD: src/sys/security/mac/mac_process.c,v 1.122 2008/01/13 14:44:13 attilio Exp $");
 
 #include "opt_mac.h"
 
@@ -365,10 +365,10 @@
 			continue;
 		vp = (struct vnode *)object->handle;
 		vfslocked = VFS_LOCK_GIANT(vp->v_mount);
-		vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
+		vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
 		result = vme->max_protection;
 		mac_vnode_check_mmap_downgrade(cred, vp, &result);
-		VOP_UNLOCK(vp, 0, td);
+		VOP_UNLOCK(vp, 0);
 		/*
 		 * Find out what maximum protection we may be allowing now
 		 * but a policy needs to get removed.
@@ -401,7 +401,7 @@
 				 */
 				vm_object_reference(object);
 				(void) vn_start_write(vp, &mp, V_WAIT);
-				vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
+				vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
 				VM_OBJECT_LOCK(object);
 				vm_object_page_clean(object,
 				    OFF_TO_IDX(offset),
@@ -409,7 +409,7 @@
 					PAGE_MASK),
 				    OBJPC_SYNC);
 				VM_OBJECT_UNLOCK(object);
-				VOP_UNLOCK(vp, 0, td);
+				VOP_UNLOCK(vp, 0);
 				vn_finished_write(mp);
 				vm_object_deallocate(object);
 				/*

==== //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/mac/mac_syscalls.c#6 (text+ko) ====

@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/security/mac/mac_syscalls.c,v 1.133 2007/10/24 19:04:01 rwatson Exp $");
+__FBSDID("$FreeBSD: src/sys/security/mac/mac_syscalls.c,v 1.135 2008/01/13 14:44:13 attilio Exp $");
 
 #include "opt_mac.h"
 
@@ -255,9 +255,9 @@
 		vp = fp->f_vnode;
 		intlabel = mac_vnode_label_alloc();
 		vfslocked = VFS_LOCK_GIANT(vp->v_mount);
-		vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
+		vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
 		mac_vnode_copy_label(vp->v_label, intlabel);
-		VOP_UNLOCK(vp, 0, td);
+		VOP_UNLOCK(vp, 0);
 		VFS_UNLOCK_GIANT(vfslocked);
 		error = mac_vnode_externalize_label(intlabel, elements,
 		    buffer, mac.m_buflen);
@@ -448,9 +448,9 @@
 			mac_vnode_label_free(intlabel);
 			break;
 		}
-		vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
+		vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
 		error = vn_setlabel(vp, intlabel, td->td_ucred);
-		VOP_UNLOCK(vp, 0, td);
+		VOP_UNLOCK(vp, 0);
 		vn_finished_write(mp);
 		VFS_UNLOCK_GIANT(vfslocked);
 		mac_vnode_label_free(intlabel);

==== //depot/projects/soc2007/zhouzhouyi_mactest_soc/sys/security/mac_test/mac_test_log.c#10 (text+ko) ====

@@ -124,7 +124,7 @@
 	vfslocked = NDHASGIANT(&nd);
 
 	logvnode = nd.ni_vp;
-	VOP_UNLOCK(logvnode, 0, curthread);
+	VOP_UNLOCK(logvnode, 0);
 
 
 	if ((error = vn_start_write(logvnode, &mp, V_WAIT)))
@@ -133,7 +133,7 @@
 	VOP_LEASE(logvnode, curthread, /*curthread->td_ucred*/thread0.td_ucred, LEASE_WRITE);
 	VATTR_NULL(&vat);
 	vat.va_size = 0;
-	vn_lock(logvnode, LK_EXCLUSIVE | LK_RETRY, curthread);
+	vn_lock(logvnode, LK_EXCLUSIVE | LK_RETRY);
 	/*do truncate */
 	error = VOP_SETATTR(logvnode, &vat, /*curthread->td_ucred*/thread0.td_ucred, curthread);
 
@@ -154,7 +154,7 @@
 	error = VOP_SETEXTATTR(logvnode, EXTATTR_NAMESPACE_SYSTEM, 
 		"mac_test", &auio, /*curthread->td_ucred*/thread0.td_ucred, curthread);
 	
-	VOP_UNLOCK(logvnode, 0, curthread);
+	VOP_UNLOCK(logvnode, 0);
 	vn_finished_write(mp);
 	loglength = 0;
 bad:



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