mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 01:30:30 -04:00
Cast pointers to (uintptr_t) before down-casting to (int). This avoids
an incompatible conversion from a 64-bit pointer to a 32-bit integer on 64-bit platforms. We will investigate whether Solaris uses a 64-bit token here, or a new record here, in order to avoid truncating user pointers that are 64-bit. However, in the mean time, truncation is fine as these are rarely/never used fields in audit records. Obtained from: TrustedBSD Project
This commit is contained in:
parent
fac3e318aa
commit
a02a1efa9f
1 changed files with 8 additions and 7 deletions
|
|
@ -683,7 +683,8 @@ kaudit_to_bsm(struct kaudit_record *kar, struct au_record **pau)
|
|||
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)) {
|
||||
|
|
@ -732,7 +733,7 @@ kaudit_to_bsm(struct kaudit_record *kar, struct au_record **pau)
|
|||
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;
|
||||
|
|
@ -766,7 +767,7 @@ kaudit_to_bsm(struct kaudit_record *kar, struct au_record **pau)
|
|||
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)) {
|
||||
|
|
@ -832,7 +833,7 @@ kaudit_to_bsm(struct kaudit_record *kar, struct au_record **pau)
|
|||
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;
|
||||
|
|
@ -870,7 +871,7 @@ kaudit_to_bsm(struct kaudit_record *kar, struct au_record **pau)
|
|||
}
|
||||
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)) {
|
||||
|
|
@ -1044,7 +1045,7 @@ kaudit_to_bsm(struct kaudit_record *kar, struct au_record **pau)
|
|||
}
|
||||
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)) {
|
||||
|
|
@ -1083,7 +1084,7 @@ kaudit_to_bsm(struct kaudit_record *kar, struct au_record **pau)
|
|||
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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue