Date: Tue, 14 Nov 2006 18:54:23 GMT From: Todd Miller <millert@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 109963 for review Message-ID: <200611141854.kAEIsNCA013004@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=109963 Change 109963 by millert@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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200611141854.kAEIsNCA013004>