From owner-p4-projects@FreeBSD.ORG Tue Oct 3 14:03:23 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 A911B16A55D; Tue, 3 Oct 2006 14:03:23 +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 6E85416A536 for ; Tue, 3 Oct 2006 14:03:23 +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 DDF4243D53 for ; Tue, 3 Oct 2006 14:03:22 +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 k93E3MGD010610 for ; Tue, 3 Oct 2006 14:03:22 GMT (envelope-from millert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k93E3MwL010605 for perforce@freebsd.org; Tue, 3 Oct 2006 14:03:22 GMT (envelope-from millert@freebsd.org) Date: Tue, 3 Oct 2006 14:03:22 GMT Message-Id: <200610031403.k93E3MwL010605@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 107165 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: Tue, 03 Oct 2006 14:03:23 -0000 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