From owner-p4-projects Thu Oct 10 6:18:11 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3980137B406; Thu, 10 Oct 2002 06:18:07 -0700 (PDT) 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 CDC4C37B408 for ; Thu, 10 Oct 2002 06:18:06 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5942B442C6 for ; Thu, 10 Oct 2002 06:11:52 -0700 (PDT) (envelope-from green@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id g9ADAhMt082012 for ; Thu, 10 Oct 2002 06:10:43 -0700 (PDT) (envelope-from green@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.3/Submit) id g9ADAgGA082009 for perforce@freebsd.org; Thu, 10 Oct 2002 06:10:42 -0700 (PDT) Date: Thu, 10 Oct 2002 06:10:42 -0700 (PDT) Message-Id: <200210101310.g9ADAgGA082009@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to green@freebsd.org using -f From: Brian Feldman Subject: PERFORCE change 19018 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://perforce.freebsd.org/p4db/chv.cgi?CH=19018 Change 19018 by green@green_laptop_2 on 2002/10/10 06:10:03 Reinitialize root filesystem vnodes that exist before SEBSD is initialized. Affected files ... .. //depot/projects/trustedbsd/mac/sys/security/sebsd/sebsd.c#36 edit Differences ... ==== //depot/projects/trustedbsd/mac/sys/security/sebsd/sebsd.c#36 (text+ko) ==== @@ -1089,12 +1089,31 @@ */ static void sebsd_create_root_mount(struct ucred *cred, struct mount *mp, - struct mount *mntlabel, struct mount *fslabel) + struct label *mntlabel, struct label *fslabel) { + struct vnode *vp, *nvp; + avc_init(); if (security_init()) { panic("SEBSD: couldn't read policy file"); } + /* + * Go through all open vnodes and reload their labels. + */ + mtx_lock(&mntvnode_mtx); + vp = TAILQ_FIRST(&mp->mnt_nvnodelist); + do { + nvp = TAILQ_NEXT(vp, v_nmntvnodes); + VI_LOCK(vp); + mtx_unlock(&mntvnode_mtx); + vn_lock(vp, LK_INTERLOCK | LK_EXCLUSIVE | LK_RETRY, curthread); + (void)sebsd_update_vnode_from_extattr(vp, &vp->v_label, mp, + fslabel); + VOP_UNLOCK(vp, 0, curthread); + mtx_lock(&mntvnode_mtx); + vp = nvp; + } while (vp != NULL); + mtx_unlock(&mntvnode_mtx); } static struct mac_policy_op_entry sebsd_ops[] = { To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message