From owner-p4-projects@FreeBSD.ORG Sat Feb 4 00:11:31 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 B7A5616A423; Sat, 4 Feb 2006 00:11:30 +0000 (GMT) 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 76FCB16A420 for ; Sat, 4 Feb 2006 00:11:30 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 25CF343D45 for ; Sat, 4 Feb 2006 00:11:30 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k140BU5d049147 for ; Sat, 4 Feb 2006 00:11:30 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k140BT1R049144 for perforce@freebsd.org; Sat, 4 Feb 2006 00:11:29 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 4 Feb 2006 00:11:29 GMT Message-Id: <200602040011.k140BT1R049144@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 Cc: Subject: PERFORCE change 91008 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: Sat, 04 Feb 2006 00:11:31 -0000 http://perforce.freebsd.org/chv.cgi?CH=91008 Change 91008 by rwatson@rwatson_freefall on 2006/02/04 00:11:29 Before casting to an integer, first cast a pointer to (uintptr_t). That way the truncating cast occurs on a compatible type. We need to investigate if Solaris has 64-bit versions of the records that place pointers in tokens, and/or if they just use a 64-bit arg token instead here. That way we could avoid truncating the addresses. Affected files ... .. //depot/projects/trustedbsd/audit3/sys/security/audit/audit_bsm.c#4 edit Differences ... ==== //depot/projects/trustedbsd/audit3/sys/security/audit/audit_bsm.c#4 (text+ko) ==== @@ -694,7 +694,8 @@ kau_write(rec, tok); } if (ARG_IS_VALID(kar, ARG_ADDR)) { - tok = au_to_arg32(1, "arg", (u_int32_t)ar->ar_arg_addr); + tok = au_to_arg32(1, "arg", + (u_int32_t)(uintptr_t)ar->ar_arg_addr); kau_write(rec, tok); } if (ARG_IS_VALID(kar, ARG_VNODE1)) { @@ -743,7 +744,7 @@ case AUE_LOADSHFILE: if (ARG_IS_VALID(kar, ARG_ADDR)) { tok = au_to_arg32(4, "base addr", - (u_int32_t)ar->ar_arg_addr); + (u_int32_t)(uintptr_t)ar->ar_arg_addr); kau_write(rec, tok); } UPATH1_VNODE1_TOKENS; @@ -777,7 +778,7 @@ case AUE_MINHERIT: if (ARG_IS_VALID(kar, ARG_ADDR)) { tok = au_to_arg32(1, "addr", - (u_int32_t)ar->ar_arg_addr); + (u_int32_t)(uintptr_t)ar->ar_arg_addr); kau_write(rec, tok); } if (ARG_IS_VALID(kar, ARG_LEN)) { @@ -843,7 +844,7 @@ case AUE_RESETSHFILE: if (ARG_IS_VALID(kar, ARG_ADDR)) { tok = au_to_arg32(1, "base addr", - (u_int32_t)ar->ar_arg_addr); + (u_int32_t)(uintptr_t)ar->ar_arg_addr); kau_write(rec, tok); } break; @@ -881,7 +882,7 @@ } if (ARG_IS_VALID(kar, ARG_ADDR)) { tok = au_to_arg32(3, "addr", - (u_int32_t)ar->ar_arg_addr); + (u_int32_t)(uintptr_t)ar->ar_arg_addr); kau_write(rec, tok); } if (ARG_IS_VALID(kar, ARG_VALUE)) { @@ -1055,7 +1056,7 @@ } if (ARG_IS_VALID(kar, ARG_SVIPC_ADDR)) { tok = au_to_arg32(2, "shmaddr", - (int)ar->ar_arg_svipc_addr); + (int)(uintptr_t)ar->ar_arg_svipc_addr); kau_write(rec, tok); } if (ARG_IS_VALID(kar, ARG_SVIPC_PERM)) { @@ -1094,7 +1095,7 @@ case AUE_SHMDT: if (ARG_IS_VALID(kar, ARG_SVIPC_ADDR)) { tok = au_to_arg32(1, "shmaddr", - (int)ar->ar_arg_svipc_addr); + (int)(uintptr_t)ar->ar_arg_svipc_addr); kau_write(rec, tok); } break;