PERFORCE change 42941 for review

Robert Watson rwatson at FreeBSD.org
Sat Nov 22 19:01:24 GMT 2003


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

Change 42941 by rwatson at rwatson_powerbook on 2003/11/22 11:00:45

	Lock the vnode before performing an access control check for
	VOP_READDIRATTR().

Affected files ...

.. //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/vfs/vfs_syscalls.c#11 edit

Differences ...

==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/vfs/vfs_syscalls.c#11 (text+ko) ====

@@ -3519,12 +3519,14 @@
         auio.uio_resid = uap->buffersize;
         
         loff = auio.uio_offset = fp->f_offset;
+        vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
 #ifdef MAC
 	error = mac_check_vnode_readdir(p->p_ucred, vp);
-	if (error)
+	if (error) {
+		VOP_UNLOCK(vp, 0, p);
 		return (error);
+	}
 #endif
-        vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
         error = VOP_READDIRATTR (vp, &attributelist, &auio,
                    actualcount, uap->options, &newstate, &eofflag,
                    &actualcount, ((u_long **)0), p->p_ucred);
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message



More information about the trustedbsd-cvs mailing list