From owner-trustedbsd-cvs@FreeBSD.ORG Fri Oct 6 17:52:54 2006 Return-Path: X-Original-To: trustedbsd-cvs@freebsd.org Delivered-To: trustedbsd-cvs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DA64C16A47B for ; Fri, 6 Oct 2006 17:52:54 +0000 (UTC) (envelope-from owner-perforce@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 96C2143D86 for ; Fri, 6 Oct 2006 17:52:38 +0000 (GMT) (envelope-from owner-perforce@freebsd.org) Received: from mx2.freebsd.org (mx2.freebsd.org [216.136.204.119]) by cyrus.watson.org (Postfix) with ESMTP id EF99A46D3C for ; Fri, 6 Oct 2006 13:52:33 -0400 (EDT) Received: from hub.freebsd.org (hub.freebsd.org [216.136.204.18]) by mx2.freebsd.org (Postfix) with ESMTP id B8672638F5; Fri, 6 Oct 2006 17:51:53 +0000 (GMT) (envelope-from owner-perforce@freebsd.org) Received: by hub.freebsd.org (Postfix, from userid 32767) id AD63816A47C; Fri, 6 Oct 2006 17:51:53 +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 61D5F16A40F for ; Fri, 6 Oct 2006 17:51:53 +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 9815143DBD for ; Fri, 6 Oct 2006 17:50:52 +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 k96Homsp065466 for ; Fri, 6 Oct 2006 17:50:48 GMT (envelope-from millert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k96HomX0065462 for perforce@freebsd.org; Fri, 6 Oct 2006 17:50:48 GMT (envelope-from millert@freebsd.org) Date: Fri, 6 Oct 2006 17:50:48 GMT Message-Id: <200610061750.k96HomX0065462@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 107365 for review X-BeenThere: trustedbsd-cvs@FreeBSD.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: TrustedBSD CVS and Perforce commit message list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2006 17:52:54 -0000 http://perforce.freebsd.org/chv.cgi?CH=107365 Change 107365 by millert@millert_g5tower on 2006/10/06 17:49:47 Move mac_vnode_label_associate_file() to mac_vfs.c and hold the vnode lock around the call to mpo_vnode_label_associate_file. Affected files ... .. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_file.c#2 edit .. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_vfs.c#11 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_file.c#2 (text+ko) ==== @@ -42,8 +42,6 @@ #include #include #include -#include -#include #include #include #include @@ -265,12 +263,3 @@ MAC_CHECK(file_check_set, cred, fp, buf, buflen); return (error); } - -void -mac_vnode_label_associate_file(struct ucred *cred, struct fileproc *fp, - struct vnode *vp) -{ - - MAC_PERFORM(vnode_label_associate_file, cred, fp, fp->f_label, - vp, vp->v_label); -} ==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_vfs.c#11 (text+ko) ==== @@ -43,6 +43,8 @@ #include #include #include +#include +#include #include #include @@ -1146,3 +1148,14 @@ return (0); } + +void +mac_vnode_label_associate_file(struct ucred *cred, struct fileproc *fp, + struct vnode *vp) +{ + + vnode_lock(vp); + MAC_PERFORM(vnode_label_associate_file, cred, fp, fp->f_label, + vp, vp->v_label); + vnode_unlock(vp); +}