PERFORCE change 18468 for review

Chris Vance cvance at freebsd.org
Tue Oct 1 15:26:57 GMT 2002


http://people.freebsd.org/~peter/p4db/chv.cgi?CH=18468

Change 18468 by cvance at cvance_laptop on 2002/10/01 08:26:45

	Make sure vnode is locked before calling VOP_GETATTR,

Affected files ...

.. //depot/projects/trustedbsd/mac/sys/security/sebsd/avc/avc.c#6 edit

Differences ...

==== //depot/projects/trustedbsd/mac/sys/security/sebsd/avc/avc.c#6 (text+ko) ====

@@ -494,10 +494,17 @@
 			if (a->u.fs.vp) {
 				struct vnode *vp = a->u.fs.vp;
 				struct vattr va;
-				VOP_GETATTR(vp, &va, curthread->td_ucred, 
-					    curthread);
-				printf(" inode=%d, fsid=%d, ftype=%d",
-				       va.va_fileid, va.va_fsid, vp->v_type);
+				if (VOP_ISLOCKED(vp, curthread) &&
+				    VOP_GETATTR(vp, &va,
+						curthread->td_ucred,
+						curthread)) {
+					printf(" inode=%d, fsid=%d, ftype=%d",
+					       va.va_fileid, va.va_fsid, 
+					       vp->v_type);
+				} else {
+					printf(" ERROR lock not held, no "
+					       "inode/fsid info available"); 
+				}
 				       
 			}
 			break;
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