From owner-p4-projects Sat Aug 3 15:38:56 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 78F9537B400; Sat, 3 Aug 2002 15:38:48 -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 3035237B405 for ; Sat, 3 Aug 2002 15:38:48 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id D54EA43EB1 for ; Sat, 3 Aug 2002 15:38:16 -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.4/8.12.4) with ESMTP id g73McGJU066296 for ; Sat, 3 Aug 2002 15:38:16 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g73McFLb066293 for perforce@freebsd.org; Sat, 3 Aug 2002 15:38:15 -0700 (PDT) Date: Sat, 3 Aug 2002 15:38:15 -0700 (PDT) Message-Id: <200208032238.g73McFLb066293@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 15500 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=15500 Change 15500 by rwatson@rwatson_curry on 2002/08/03 15:37:28 Revise logic so that we allow equal labels to be set based on the subject single being equal, the range starting or ending with equal, or the range being LOW-HIGH. Affected files ... .. //depot/projects/trustedbsd/mac/sys/security/mac_biba/mac_biba.c#88 edit Differences ... ==== //depot/projects/trustedbsd/mac/sys/security/mac_biba/mac_biba.c#88 (text+ko) ==== @@ -290,6 +290,28 @@ } static int +mac_biba_subj_equal_ok(struct mac_biba *mac_biba) +{ + + /* If the single is EQUAL, it's ok */ + if (mac_biba->mb_single.mbe_type == MAC_BIBA_TYPE_EQUAL) + return (0); + + /* If either range endpoint is EQUAL, it's ok */ + if (mac_biba->mb_rangelow.mbe_type == MAC_BIBA_TYPE_EQUAL || + mac_biba->mb_rangehigh.mbe_type == MAC_BIBA_TYPE_EQUAL) + return (0); + + /* If the range is low-high, it's ok */ + if (mac_biba->mb_rangelow.mbe_type == MAC_BIBA_TYPE_LOW && + mac_biba->mb_rangehigh.mbe_type == MAC_BIBA_TYPE_HIGH) + return (0); + + /* It's not OK. */ + return (EPERM); +} + +static int mac_biba_valid(struct mac_biba *mac_biba) { @@ -1250,7 +1272,7 @@ * If the old subject label doesn't contain EQUAL, don't let the * new subject label contain EQUAL. */ - if (mac_biba_contains_equal(new) && !mac_biba_contains_equal(subj)) + if (mac_biba_contains_equal(new) && !mac_biba_subj_equal_ok(subj)) return (EPERM); return (0); @@ -1406,7 +1428,7 @@ * If the subject label doesn't contain equal, don't let the new * pipe label contain equal. */ - if (mac_biba_contains_equal(new) && !mac_biba_contains_equal(subj)) + if (mac_biba_contains_equal(new) && !mac_biba_subj_equal_ok(subj)) return (EPERM); return (0); @@ -1528,7 +1550,7 @@ * If the subject label doesn't contain EQUAL, don't let the new * socket label contain EQUAL. */ - if (mac_biba_contains_equal(new) && !mac_biba_contains_equal(subj)) + if (mac_biba_contains_equal(new) && !mac_biba_subj_equal_ok(subj)) return (EPERM); return (0); @@ -1820,7 +1842,7 @@ * If the subject label doesn't contain EQUAL, don't let the new * vnode label contain EQUAL. */ - if (mac_biba_contains_equal(new) && !mac_biba_contains_equal(subj)) + if (mac_biba_contains_equal(new) && !mac_biba_subj_equal_ok(subj)) return (EPERM); return (suser_cred(cred, 0)); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message