From owner-p4-projects@FreeBSD.ORG Wed Aug 30 21:34:39 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9D1D816A4DE; Wed, 30 Aug 2006 21:34:39 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 624AE16A4E1 for ; Wed, 30 Aug 2006 21:34:39 +0000 (UTC) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4615E43D5E for ; Wed, 30 Aug 2006 21:34:30 +0000 (GMT) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k7ULYL2M038626 for ; Wed, 30 Aug 2006 21:34:21 GMT (envelope-from millert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k7ULYLZL038623 for perforce@freebsd.org; Wed, 30 Aug 2006 21:34:21 GMT (envelope-from millert@freebsd.org) Date: Wed, 30 Aug 2006 21:34:21 GMT Message-Id: <200608302134.k7ULYLZL038623@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to millert@freebsd.org using -f From: Todd Miller To: Perforce Change Reviews Cc: Subject: PERFORCE change 105373 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Aug 2006 21:34:39 -0000 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); }