From owner-p4-projects Sun Sep 22 9:32:15 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 20B8037B401; Sun, 22 Sep 2002 09:32:13 -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 B9CBD37B404 for ; Sun, 22 Sep 2002 09:32:12 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3392C43E3B for ; Sun, 22 Sep 2002 09:32:12 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from freefall.freebsd.org (perforce@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g8MGWCCo051490 for ; Sun, 22 Sep 2002 09:32:12 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g8MGWBkY051428 for perforce@freebsd.org; Sun, 22 Sep 2002 09:32:11 -0700 (PDT) Date: Sun, 22 Sep 2002 09:32:11 -0700 (PDT) Message-Id: <200209221632.g8MGWBkY051428@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 17933 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://people.freebsd.org/~peter/p4db/chv.cgi?CH=17933 Change 17933 by rwatson@rwatson_paprika on 2002/09/22 09:31:12 Apparently I neglected to commit the mac_mls implementation of mpo_check_vnode_link() when I added that. Presumably a missed p4 edit after a local chmod +w while on travel. Here it is. As with other implementations, we have to wait for the IFC of the VOP_LINK() changes from Don Lewis before we can do the label checks on the target vnode. Affected files ... .. //depot/projects/trustedbsd/mac/sys/security/mac_mls/mac_mls.c#92 edit Differences ... ==== //depot/projects/trustedbsd/mac/sys/security/mac_mls/mac_mls.c#92 (text+ko) ==== @@ -1691,6 +1691,31 @@ } static int +mac_mls_check_vnode_link(struct ucred *cred, struct vnode *dvp, + struct label *dlabel, struct vnode *vp, struct label *label, + struct componentname *cnp) +{ + struct mac_mls *subj, *obj; + + if (!mac_mls_enabled) + return (0); + + subj = SLOT(&cred->cr_label); + obj = SLOT(dlabel); + + if (!mac_mls_dominate_single(obj, subj)) + return (EACCES); + +#if 0 + obj = SLOT(dlabel); + if (!mac_mls_dominate_single(obj, subj)) + return (EACCES); +#endif + + return (0); +} + +static int mac_mls_check_vnode_lookup(struct ucred *cred, struct vnode *dvp, struct label *dlabel, struct componentname *cnp) { @@ -2308,6 +2333,8 @@ (macop_t)mac_mls_check_vnode_getacl }, { MAC_CHECK_VNODE_GETEXTATTR, (macop_t)mac_mls_check_vnode_getextattr }, + { MAC_CHECK_VNODE_LINK, + (macop_t)mac_mls_check_vnode_link }, { MAC_CHECK_VNODE_LOOKUP, (macop_t)mac_mls_check_vnode_lookup }, { MAC_CHECK_VNODE_OPEN, To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message