From: Dmitry V. Levin Date: Tue, 20 Dec 2016 01:11:53 +0000 (+0000) Subject: x32: fix decoding of mprotect and pkey_mprotect syscall arguments X-Git-Tag: v4.16~321 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=874caabc0f3f930252de082d4189163997c6ead0;p=strace 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. --- diff --git a/mem.c b/mem.c index 437b8ea5..b683a095 100644 --- a/mem.c +++ b/mem.c @@ -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]);