x32: fix decoding of mprotect and pkey_mprotect syscall arguments

As there are no compat versions of mprotect or pkey_mprotect syscalls
in x32 personality, "addr", "len", and "prot" syscall arguments have
kernel_ulong_t type and should be printed accordingly.

* mem.c (do_mprotect): Retrieve 1st, 2nd and 3rd arguments using
getarg_klu, print them using printaddr_klu, PRI_klu format,
and printflags64, correspondingly.
This commit is contained in:
Дмитрий Левин 2016-12-20 01:11:53 +00:00
parent 6caa97f543
commit 874caabc0f

6
mem.c
View File

@ -185,9 +185,9 @@ SYS_FUNC(munmap)
static int
do_mprotect(struct tcb *tcp, bool has_pkey)
{
printaddr(tcp->u_arg[0]);
tprintf(", %lu, ", tcp->u_arg[1]);
printflags_long(mmap_prot, tcp->u_arg[2], "PROT_???");
printaddr_klu(getarg_klu(tcp, 0));
tprintf(", %" PRI_klu ", ", getarg_klu(tcp, 1));
printflags64(mmap_prot, getarg_klu(tcp, 2), "PROT_???");
if (has_pkey)
tprintf(", %d", (int) tcp->u_arg[3]);