From: Dmitry V. Levin Date: Fri, 19 Aug 2016 22:57:27 +0000 (+0000) Subject: Fix decoding of indirect shmat's return code for non-native personalities X-Git-Tag: v4.14~187 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3dfed0ef4e52d71d3bcad6127e1f6b78b9206721;p=strace Fix decoding of indirect shmat's return code for non-native personalities * ipc_shm.c (SYS_FUNC(shmat)): Fetch current_wordsize bytes of data to obtain return code of indirect shmat subcall. --- diff --git a/ipc_shm.c b/ipc_shm.c index b2059c2b..e8a8206b 100644 --- a/ipc_shm.c +++ b/ipc_shm.c @@ -72,10 +72,14 @@ SYS_FUNC(shmat) if (syserror(tcp)) return 0; if (indirect_ipccall(tcp)) { - unsigned long raddr; - if (umove(tcp, tcp->u_arg[2], &raddr) < 0) + union { + uint64_t r64; + uint32_t r32; + } u; + if (umoven(tcp, tcp->u_arg[2], current_wordsize, &u) < 0) return RVAL_NONE; - tcp->u_rval = raddr; + tcp->u_rval = (sizeof(u.r32) == current_wordsize) + ? u.r32 : u.r64; } return RVAL_HEX; }