Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Oct 2006 14:03:22 GMT
From:      Todd Miller <millert@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 107165 for review
Message-ID:  <200610031403.k93E3MwL010605@repoman.freebsd.org>

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

Change 107165 by millert@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



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