From: Elvira Khabirova Date: Wed, 29 Jul 2015 18:38:54 +0000 (+0300) Subject: Fix oldselect decoding on 64-bit architectures X-Git-Tag: v4.11~314 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c44df3e3ca1e632383726744728d6b7f61a6f449;p=strace Fix oldselect decoding on 64-bit architectures As struct sel_arg_struct is an array of 32-bit values, fetch it using an intermediate array on 64-bit architectures. * desc.c (sys_oldselect): Rename args to long_args. [SIZEOF_LONG == 4] Alias oldselect_args to long_args. [SIZEOF_LONG != 4] Introduce oldselect_args to fetch oldselect args. * linux/sh64/syscallent.h (oldselect): Remove. --- diff --git a/desc.c b/desc.c index d9e88b15..32327c26 100644 --- a/desc.c +++ b/desc.c @@ -410,13 +410,26 @@ decode_select(struct tcb *tcp, long *args, enum bitness_t bitness) SYS_FUNC(oldselect) { - long args[5]; + long long_args[5]; +#undef oldselect_args +#if SIZEOF_LONG == 4 +# define oldselect_args long_args +#else + unsigned int oldselect_args[5]; + unsigned int i; +#endif - if (umove(tcp, tcp->u_arg[0], &args) < 0) { + if (umove(tcp, tcp->u_arg[0], &oldselect_args) < 0) { printaddr(tcp->u_arg[0]); return 0; } - return decode_select(tcp, args, BITNESS_CURRENT); +#ifndef oldselect_args + for (i = 0; i < 5; i++) { + long_args[i] = oldselect_args[i]; + } +#endif + return decode_select(tcp, long_args, BITNESS_CURRENT); +#undef oldselect_args } #ifdef ALPHA diff --git a/linux/sh64/syscallent.h b/linux/sh64/syscallent.h index 852c03fd..4caf6b9c 100644 --- a/linux/sh64/syscallent.h +++ b/linux/sh64/syscallent.h @@ -108,7 +108,7 @@ [ 79] = { 2, 0, SEN(settimeofday), "settimeofday" }, [ 80] = { 2, 0, SEN(getgroups16), "getgroups" }, [ 81] = { 2, 0, SEN(setgroups16), "setgroups" }, -[ 82] = { 1, TD, SEN(oldselect), "oldselect" }, +[ 82] = { }, [ 83] = { 2, TF, SEN(symlink), "symlink" }, [ 84] = { 2, TF, SEN(oldlstat), "oldlstat" }, [ 85] = { 3, TF, SEN(readlink), "readlink" },