Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Aug 2006 21:34:21 GMT
From:      Todd Miller <millert@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 105373 for review
Message-ID:  <200608302134.k7ULYLZL038623@repoman.freebsd.org>

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

Change 105373 by millert@millert_g4tower on 2006/08/30 21:33:36

	The label on a label handle is a task label, not a port
	label so call the appropriate entry point.  There are some
	mismatches we can't fix yet due to non-existent entrypoints
	so just note those with an XXX for now.  In practice this
	doesn't cause problems since policies use the same label
	structure for ports and tasks.  We really need task label
	internalize, external and copy entrypoints or we should
	just collapse port and task labels into a single label type.

Affected files ...

.. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/osfmk/ipc/ipc_labelh.c#4 edit

Differences ...

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

@@ -90,13 +90,14 @@
 	struct label inl;
 	kern_return_t kr;
 
-	mac_port_init_label(&inl);
+	mac_task_init_label(&inl);
+	/* XXX - should be mac_task_internalize_label */
 	if (mac_port_internalize_label(&inl, labelstr))
 		return (KERN_INVALID_ARGUMENT);
 
 	kr = labelh_new_user(space, &inl, namep);
 	if (kr != KERN_SUCCESS) {
-		mac_port_destroy_label(&inl);
+		mac_task_destroy_label(&inl);
 		return (kr);
 	}
 
@@ -139,7 +140,8 @@
 
 	lh = labelh_new();
 	ip_lock(lh->lh_port);
-	mac_port_init_label(&lh->lh_label);
+	mac_task_init_label(&lh->lh_label);
+	/* XXX - should be mac_task_copy_label */
 	mac_port_copy_label(&old->lh_label, &lh->lh_label);
 	ip_unlock(lh->lh_port);
 	return (lh);
@@ -202,6 +204,6 @@
 {
 	ipc_labelh_t lh = (ipc_labelh_t) port->ip_kobject;
 
-	mac_port_destroy_label(&lh->lh_label);
+	mac_task_destroy_label(&lh->lh_label);
 	zfree(ipc_labelh_zone, (vm_offset_t)lh);
 }



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