Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Oct 2002 13:43:27 -0700 (PDT)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 20077 for review
Message-ID:  <200210242043.g9OKhRqt028063@repoman.freebsd.org>

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

Change 20077 by rwatson@rwatson_tislabs on 2002/10/24 13:43:05

	A bit better pass at mprotect check -- not quite right yet,
	so leave it disabled, since we don't have a good cred.

Affected files ...

.. //depot/projects/trustedbsd/mac/sys/vm/vm_map.c#17 edit

Differences ...

==== //depot/projects/trustedbsd/mac/sys/vm/vm_map.c#17 (text+ko) ====

@@ -1235,6 +1235,13 @@
 {
 	vm_map_entry_t current;
 	vm_map_entry_t entry;
+#ifdef MAC
+#if 0
+	vm_object_t object;
+	struct vnode *vp;
+	int error;
+#endif
+#endif
 
 	vm_map_lock(map);
 
@@ -1260,19 +1267,17 @@
 			return (KERN_PROTECTION_FAILURE);
 		}
 #ifdef MAC
-		/* XXXMAC: Checks against MAC labels should go here. */
 #if 0
 		/* Find the deepest backing object. */
-		vm_object_t object;
-		object = vme->object.vm_object;
+		object = current->object.vm_object;
 		while (object->backing_object != NULL)
 			object = object->backing_object;
 		switch (object->type) {
 		case OBJT_VNODE:
-			struct vnode *vp = (struct vnode *)object->handle;
-			vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
+			vp = (struct vnode *)object->handle;
+			vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curthread);
 			error = mac_check_vnode_mprotect(cred, vp, new_prot);
-			VOP_UNLOCK(vp, 0, td);
+			VOP_UNLOCK(vp, 0, curthread);
 			if (error)
 				return (KERN_PROTECTION_FAILURE);
 			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?200210242043.g9OKhRqt028063>