PERFORCE change 107165 for review

Todd Miller millert at FreeBSD.org
Tue Oct 3 07:03:54 PDT 2006


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

Change 107165 by millert at millert_macbook on 2006/10/03 14:03:08

	Add missing tasklabel_lock/unlock pair around call to
	mac_port_check_setlabel().

Affected files ...

.. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/osfmk/ipc/mach_port.c#3 edit

Differences ...

==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/osfmk/ipc/mach_port.c#3 (text+ko) ====

@@ -1898,6 +1898,7 @@
 	ipc_entry_t entry;
 	kern_return_t kr;
 	struct label inl;
+	ipc_port_t port;
 	int rc;
 
 	if (space == IS_NULL || space->is_task == NULL)
@@ -1915,17 +1916,18 @@
 	if (kr != KERN_SUCCESS)
 		return kr;
 
-	if (IOT_PORT != io_otype(entry->ie_object)) {
+	if (io_otype(entry->ie_object) != IOT_PORT) {
 		is_write_unlock(space);
 		return KERN_INVALID_RIGHT;
 	}
 
-	ipc_port_t port = (ipc_port_t) entry->ie_object;
+	port = (ipc_port_t) entry->ie_object;
+	ip_lock(port);
 
-	ip_lock (port);
-
+	tasklabel_lock(space->is_task);
 	rc = mac_port_check_setlabel(&space->is_task->maclabel,
 				    &port->ip_label, &inl);
+	tasklabel_unlock(space->is_task);
 	if (rc)
 		kr = KERN_NO_ACCESS;
 	else


More information about the trustedbsd-cvs mailing list