PERFORCE change 109963 for review

Todd Miller millert at FreeBSD.org
Tue Nov 14 19:04:25 UTC 2006


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

Change 109963 by millert at millert_g5tower on 2006/11/14 18:53:27

	Add mac_task_get_label() to return a label's task; you must already
	be holding a reference to the task for this to be safe.  An alternate
	approach would be for mac_task_get_label() to take a reference to
	the label handle itself, but this would require the caller to drop
	the handle which is not possible due to struct task * being opaque.

Affected files ...

.. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/osfmk/kern/task.c#7 edit
.. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_mach_internal.h#9 edit

Differences ...

==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/osfmk/kern/task.c#7 (text+ko) ====

@@ -1760,4 +1760,10 @@
 		lh_check_unlock(oldlabel);
 	tasklabel_unlock(task);
 }
+
+struct label *
+mac_task_get_label(struct task *task)
+{
+	return (&task->maclabel);
+}
 #endif

==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_mach_internal.h#9 (text+ko) ====

@@ -46,6 +46,7 @@
 void mac_task_label_associate_kernel(struct task *, struct label *, struct label *);
 void mac_task_label_modify( struct task *pt, void *arg,
     void (*f)(struct label *l, void *arg));
+struct label *mac_task_get_label(struct task *task);
 
 /* ports */
 void mac_port_label_init(struct label *l);


More information about the trustedbsd-cvs mailing list