Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Oct 2002 08:26:57 -0700 (PDT)
From:      Chris Vance <cvance@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 18468 for review
Message-ID:  <200210011526.g91FQvsx057010@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=18468

Change 18468 by cvance@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@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




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