From owner-p4-projects Tue Oct 29 14: 3:10 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6F95837B404; Tue, 29 Oct 2002 14:03:07 -0800 (PST) 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 07B3937B401 for ; Tue, 29 Oct 2002 14:03:07 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B2DE043E88 for ; Tue, 29 Oct 2002 14:03:06 -0800 (PST) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id g9TM1tmV060972 for ; Tue, 29 Oct 2002 14:01:55 -0800 (PST) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id g9TM1s0J060969 for perforce@freebsd.org; Tue, 29 Oct 2002 14:01:54 -0800 (PST) Date: Tue, 29 Oct 2002 14:01:54 -0800 (PST) Message-Id: <200210292201.g9TM1s0J060969@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 20378 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/chv.cgi?CH=20378 Change 20378 by rwatson@rwatson_tislabs on 2002/10/29 14:01:12 Teach Biba about acct() -- note that if the target label is NULL (i.e., we're turning off accounting), we require only privilege; if it's non-NULL, then we require privilege and that the target file be high integrity. Affected files ... .. //depot/projects/trustedbsd/mac/sys/security/mac_biba/mac_biba.c#167 edit Differences ... ==== //depot/projects/trustedbsd/mac/sys/security/mac_biba/mac_biba.c#167 (text+ko) ==== @@ -1873,6 +1873,29 @@ } static int +mac_biba_check_system_acct(struct ucred *cred, struct vnode *vp, + struct label *label) +{ + struct mac_biba *subj, *obj; + + if (!mac_biba_enabled) + return (0); + + subj = SLOT(&cred->cr_label); + + if (!mac_biba_subject_privileged(subj)) + return (EPERM); + + if (label == NULL) + return (0); + + obj = SLOT(label); + if (!mac_biba_high_single(obj)) + return (EACCES); + + return (0); +} +static int mac_biba_check_system_swapon(struct ucred *cred, struct vnode *vp, struct label *label) { @@ -2708,6 +2731,8 @@ (macop_t)mac_biba_check_socket_relabel }, { MAC_CHECK_SOCKET_VISIBLE, (macop_t)mac_biba_check_socket_visible }, + { MAC_CHECK_SYSTEM_ACCT, + (macop_t)mac_biba_check_system_acct }, { MAC_CHECK_SYSTEM_SWAPON, (macop_t)mac_biba_check_system_swapon }, { MAC_CHECK_SYSTEM_SYSCTL, To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message