Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Feb 2009 21:59:54 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r188735 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb kern security/audit
Message-ID:  <200902172159.n1HLxsdo028840@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Tue Feb 17 21:59:54 2009
New Revision: 188735
URL: http://svn.freebsd.org/changeset/base/188735

Log:
  MFC: Use shared vnode locks for auditing vnode arguments.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/kern/vfs_syscalls.c
  stable/7/sys/security/audit/audit_arg.c

Modified: stable/7/sys/kern/vfs_syscalls.c
==============================================================================
--- stable/7/sys/kern/vfs_syscalls.c	Tue Feb 17 21:35:54 2009	(r188734)
+++ stable/7/sys/kern/vfs_syscalls.c	Tue Feb 17 21:59:54 2009	(r188735)
@@ -2525,7 +2525,7 @@ fchflags(td, uap)
 		return (error);
 	vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount);
 #ifdef AUDIT
-	vn_lock(fp->f_vnode, LK_EXCLUSIVE | LK_RETRY, td);
+	vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY, td);
 	AUDIT_ARG(vnode, fp->f_vnode, ARG_VNODE1);
 	VOP_UNLOCK(fp->f_vnode, 0, td);
 #endif
@@ -2665,7 +2665,7 @@ fchmod(td, uap)
 		return (error);
 	vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount);
 #ifdef AUDIT
-	vn_lock(fp->f_vnode, LK_EXCLUSIVE | LK_RETRY, td);
+	vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY, td);
 	AUDIT_ARG(vnode, fp->f_vnode, ARG_VNODE1);
 	VOP_UNLOCK(fp->f_vnode, 0, td);
 #endif
@@ -2822,7 +2822,7 @@ fchown(td, uap)
 		return (error);
 	vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount);
 #ifdef AUDIT
-	vn_lock(fp->f_vnode, LK_EXCLUSIVE | LK_RETRY, td);
+	vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY, td);
 	AUDIT_ARG(vnode, fp->f_vnode, ARG_VNODE1);
 	VOP_UNLOCK(fp->f_vnode, 0, td);
 #endif
@@ -3035,7 +3035,7 @@ kern_futimes(struct thread *td, int fd, 
 		return (error);
 	vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount);
 #ifdef AUDIT
-	vn_lock(fp->f_vnode, LK_EXCLUSIVE | LK_RETRY, td);
+	vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY, td);
 	AUDIT_ARG(vnode, fp->f_vnode, ARG_VNODE1);
 	VOP_UNLOCK(fp->f_vnode, 0, td);
 #endif

Modified: stable/7/sys/security/audit/audit_arg.c
==============================================================================
--- stable/7/sys/security/audit/audit_arg.c	Tue Feb 17 21:35:54 2009	(r188734)
+++ stable/7/sys/security/audit/audit_arg.c	Tue Feb 17 21:59:54 2009	(r188735)
@@ -633,7 +633,7 @@ audit_arg_file(struct proc *p, struct fi
 		 */
 		vp = fp->f_vnode;
 		vfslocked = VFS_LOCK_GIANT(vp->v_mount);
-		vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curthread);
+		vn_lock(vp, LK_SHARED | LK_RETRY, curthread);
 		audit_arg_vnode(vp, ARG_VNODE1);
 		VOP_UNLOCK(vp, 0, curthread);
 		VFS_UNLOCK_GIANT(vfslocked);
@@ -851,7 +851,7 @@ audit_sysclose(struct thread *td, int fd
 
 	vp = fp->f_vnode;
 	vfslocked = VFS_LOCK_GIANT(vp->v_mount);
-	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
+	vn_lock(vp, LK_SHARED | LK_RETRY, td);
 	audit_arg_vnode(vp, ARG_VNODE1);
 	VOP_UNLOCK(vp, 0, td);
 	VFS_UNLOCK_GIANT(vfslocked);



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