PERFORCE change 91008 for review

Robert Watson rwatson at FreeBSD.org
Sat Feb 4 00:11:29 GMT 2006


http://perforce.freebsd.org/chv.cgi?CH=91008

Change 91008 by rwatson at 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;
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message



More information about the trustedbsd-cvs mailing list