From owner-p4-projects@FreeBSD.ORG Tue Nov 4 17:02:27 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8479016A4D0; Tue, 4 Nov 2003 17:02:27 -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 458E116A4CF for ; Tue, 4 Nov 2003 17:02:27 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4E58E43FE3 for ; Tue, 4 Nov 2003 17:02:26 -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.9/8.12.9) with ESMTP id hA512QXJ094574 for ; Tue, 4 Nov 2003 17:02:26 -0800 (PST) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.9/8.12.9/Submit) id hA512Pui094571 for perforce@freebsd.org; Tue, 4 Nov 2003 17:02:25 -0800 (PST) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Tue, 4 Nov 2003 17:02:25 -0800 (PST) Message-Id: <200311050102.hA512Pui094571@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 To: Perforce Change Reviews Subject: PERFORCE change 41400 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2003 01:02:27 -0000 http://perforce.freebsd.org/chv.cgi?CH=41400 Change 41400 by rwatson@rwatson_paprika on 2003/11/04 17:02:13 Slide trustedbsd_sebsd to the head of trustedbsd_mac: Add mac_support.4. Clean up unnecessary error-checking of malloc return values in uipc_sem.c. Sync mac_internal.h to version in main FreeBSD tree. Affected files ... .. //depot/projects/trustedbsd/sebsd/share/man/man4/Makefile#6 integrate .. //depot/projects/trustedbsd/sebsd/share/man/man4/mac.4#3 integrate .. //depot/projects/trustedbsd/sebsd/share/man/man4/mac_support.4#1 branch .. //depot/projects/trustedbsd/sebsd/sys/kern/uipc_sem.c#7 integrate .. //depot/projects/trustedbsd/sebsd/sys/security/mac/mac_internal.h#5 integrate Differences ... ==== //depot/projects/trustedbsd/sebsd/share/man/man4/Makefile#6 (text+ko) ==== @@ -128,6 +128,7 @@ mac_partition.4 \ mac_portacl.4 \ mac_seeotheruids.4 \ + mac_support.4 \ mac_stub.4 \ mac_test.4 \ mouse.4 \ ==== //depot/projects/trustedbsd/sebsd/share/man/man4/mac.4#3 (text+ko) ==== @@ -48,6 +48,9 @@ they cannot override traditional .Ux security provisions such as file permissions and superuser checks. +Support (and non-support) for a variety of kernel features is documented +in +.Xr mac_support 4 . .Pp Currently, the following MAC policy modules are shipped with .Fx : @@ -247,6 +250,7 @@ .Xr mac_partition 4 , .Xr mac_portacl 4 , .Xr mac_seeotheruids 4 , +.Xr max_support 4 , .Xr mac_test 4 , .Xr login.conf 5 , .Xr maclabel 7 , ==== //depot/projects/trustedbsd/sebsd/sys/kern/uipc_sem.c#7 (text+ko) ==== @@ -1,6 +1,6 @@ /* * Copyright (c) 2002 Alfred Perlstein - * Copyright (c) 2001, 2002, 2003 Networks Associates Technology, Inc. + * Copyright (c) 2003 Networks Associates Technology, Inc. * All rights reserved. * * This software was developed for the FreeBSD Project in part by Network @@ -227,8 +227,7 @@ /* XXX Use p31b_getcfg(CTL_P1003_1B_SEM_VALUE_MAX) instead? */ if (value > SEM_VALUE_MAX) return (EINVAL); - if( (ret = malloc(sizeof(*ret), M_SEM, M_WAITOK | M_ZERO)) == NULL) - return (ENOMEM); + ret = malloc(sizeof(*ret), M_SEM, M_WAITOK | M_ZERO); if (name != NULL) { len = strlen(name); if (len > SEM_MAX_NAMELEN) { @@ -240,10 +239,7 @@ free(ret, M_SEM); return (EINVAL); } - if( (ret->ks_name = malloc(len + 1, M_SEM, M_WAITOK)) == NULL){ - free(ret, M_SEM); - return (ENOMEM); - } + ret->ks_name = malloc(len + 1, M_SEM, M_WAITOK); strcpy(ret->ks_name, name); } else { ret->ks_name = NULL; @@ -598,8 +594,7 @@ mtx_assert(&sem_lock, MA_NOTOWNED); mtx_assert(&ks->ks_mtx, MA_NOTOWNED); - if( (ku = malloc(sizeof(*ku), M_SEM, M_WAITOK | M_ZERO)) == NULL) - return; + ku = malloc(sizeof(*ku), M_SEM, M_WAITOK | M_ZERO); ku->ku_pid = p->p_pid; mtx_lock(&sem_lock); k = sem_getuser(p, ks); ==== //depot/projects/trustedbsd/sebsd/sys/security/mac/mac_internal.h#5 (text+ko) ==== @@ -32,6 +32,8 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * $FreeBSD: src/sys/security/mac/mac_internal.h,v 1.103 2003/10/25 15:28:20 rwatson Exp $ */ /* @@ -48,6 +50,7 @@ * MAC Framework global types and typedefs. */ LIST_HEAD(mac_policy_list_head, mac_policy_conf); +MALLOC_DECLARE(M_MACTEMP); /* * MAC Framework global variables. @@ -63,11 +66,6 @@ #endif /* - * MAC Framework global types and constants. - */ -MALLOC_DECLARE(M_MACTEMP); - -/* * MAC Framework object/access counter primitives, conditionally * compiled. */