From 54a4a1a9181d7789a60fd5ab515e17d55fa27ef1 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Wed, 28 Sep 2016 01:57:59 +0000 Subject: [PATCH] mips o32: implement fetching the 7th subcall argument * syscall.c [LINUX_MIPSO32] (decode_mips_subcall): Fetch the last argument of 7-arg syscalls. --- syscall.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/syscall.c b/syscall.c index 9627d68d..f649a907 100644 --- a/syscall.c +++ b/syscall.c @@ -643,11 +643,18 @@ decode_mips_subcall(struct tcb *tcp) sizeof(tcp->u_arg) - sizeof(tcp->u_arg[0])); /* * Fetching the last arg of 7-arg syscalls (fadvise64_64 - * and sync_file_range) would require additional code, + * and sync_file_range) requires additional code, * see linux/mips/get_syscall_args.c */ + if (tcp->s_ent->nargs == MAX_ARGS) { + if (umoven(tcp, + mips_REG_SP + MAX_ARGS * sizeof(tcp->u_arg[0]), + sizeof(tcp->u_arg[0]), + &tcp->u_arg[MAX_ARGS - 1]) < 0) + tcp->u_arg[MAX_ARGS - 1] = 0; + } } -#endif +#endif /* LINUX_MIPSO32 */ static void dumpio(struct tcb *tcp) -- 2.40.0