From: Dmitry V. Levin Date: Mon, 19 Dec 2016 12:34:51 +0000 (+0000) Subject: s390: fix decoding of mmap2 syscall when arguments are not available X-Git-Tag: v4.16~337 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=29107a40e905e7fa70f1e5ee16c5f98a3a273a76;p=strace s390: fix decoding of mmap2 syscall when arguments are not available * mem.c [S390] (SYS_FUNC(old_mmap_pgoff)): Use umove_or_printaddr instead of umoven to fetch mmap arguments, fix return value when this fetch fails. --- diff --git a/mem.c b/mem.c index 1ce4d92e..453a64e3 100644 --- a/mem.c +++ b/mem.c @@ -112,7 +112,7 @@ SYS_FUNC(old_mmap) } #endif /* old_mmap architectures */ -#if defined(S390) +#ifdef S390 /* Params are pointed to by u_arg[0], offset is in pages */ SYS_FUNC(old_mmap_pgoff) { @@ -120,8 +120,8 @@ SYS_FUNC(old_mmap_pgoff) int i; unsigned narrow_arg[6]; unsigned long long offset; - if (umoven(tcp, tcp->u_arg[0], sizeof(narrow_arg), narrow_arg) == -1) - return 0; + if (umove_or_printaddr(tcp, tcp->u_arg[0], &narrow_arg)) + return RVAL_DECODED | RVAL_HEX; for (i = 0; i < 5; i++) u_arg[i] = (unsigned long) narrow_arg[i]; offset = narrow_arg[5]; @@ -130,7 +130,7 @@ SYS_FUNC(old_mmap_pgoff) return RVAL_DECODED | RVAL_HEX; } -#endif +#endif /* S390 */ /* Params are passed directly, offset is in bytes */ SYS_FUNC(mmap)