From owner-p4-projects@FreeBSD.ORG Fri Jun 30 01:26:38 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C553B16A4E6; Fri, 30 Jun 2006 01:26:37 +0000 (UTC) X-Original-To: perforce@freebsd.org 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 9FEF516A4E0 for ; Fri, 30 Jun 2006 01:26:37 +0000 (UTC) (envelope-from wsalamon@computer.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B96C244746 for ; Fri, 30 Jun 2006 00:59:58 +0000 (GMT) (envelope-from wsalamon@computer.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k5U0xwIp047682 for ; Fri, 30 Jun 2006 00:59:58 GMT (envelope-from wsalamon@computer.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k5U0xwvZ047679 for perforce@freebsd.org; Fri, 30 Jun 2006 00:59:58 GMT (envelope-from wsalamon@computer.org) Date: Fri, 30 Jun 2006 00:59:58 GMT Message-Id: <200606300059.k5U0xwvZ047679@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to wsalamon@computer.org using -f From: Wayne Salamon To: Perforce Change Reviews Cc: Subject: PERFORCE change 100324 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jun 2006 01:26:38 -0000 http://perforce.freebsd.org/chv.cgi?CH=100324 Change 100324 by wsalamon@vh3 on 2006/06/30 00:59:30 When creating subejct32_ex or process32_ex tokens, assert that we have a known address type. However, anyting but AU_IPv6 will get 4 bytes of the address written. Affected files ... .. //depot/projects/trustedbsd/audit3/sys/security/audit/audit_bsm_token.c#20 edit Differences ... ==== //depot/projects/trustedbsd/audit3/sys/security/audit/audit_bsm_token.c#20 (text+ko) ==== @@ -30,7 +30,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/audit3/sys/security/audit/audit_bsm_token.c#19 $ + * $P4: //depot/projects/trustedbsd/audit3/sys/security/audit/audit_bsm_token.c#20 $ * $FreeBSD: src/sys/security/audit/audit_bsm_token.c,v 1.4 2006/06/17 13:53:04 wsalamon Exp $ */ @@ -618,14 +618,14 @@ token_t *t; u_char *dptr = NULL; - if (tid->at_type == AU_IPv4) - GET_TOKEN_AREA(t, dptr, sizeof(u_char) + - 10 * sizeof(u_int32_t)); - else if (tid->at_type == AU_IPv6) - GET_TOKEN_AREA(t, dptr, sizeof(u_char) + - 13 * sizeof(u_int32_t)); + KASSERT((tid->at_type == AU_IPv4) || (tid->at_type == AU_IPv6), + ("au_to_process32_ex: type %u", (unsigned int)tid->at_type)); + if (tid->at_type == AU_IPv6) + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 13 * + sizeof(u_int32_t)); else - return (NULL); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 10 * + sizeof(u_int32_t)); ADD_U_CHAR(dptr, AUT_PROCESS32_EX); ADD_U_INT32(dptr, auid); @@ -955,14 +955,14 @@ token_t *t; u_char *dptr = NULL; - if (tid->at_type == AU_IPv4) - GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 10 * - sizeof(u_int32_t)); - else if (tid->at_type == AU_IPv6) + KASSERT((tid->at_type == AU_IPv4) || (tid->at_type == AU_IPv6), + ("au_to_subject32_ex: type %u", (unsigned int)tid->at_type)); + if (tid->at_type == AU_IPv6) GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 13 * sizeof(u_int32_t)); else - return (NULL); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 10 * + sizeof(u_int32_t)); ADD_U_CHAR(dptr, AUT_SUBJECT32_EX); ADD_U_INT32(dptr, auid);