From e294db7e539776a9b34e7addfab232f154309db2 Mon Sep 17 00:00:00 2001 From: Tomoki Shirasawa Date: Tue, 26 Sep 2017 14:29:02 +0900 Subject: [PATCH] syscall: set syscall_return before calling ptrace_syscall_exit refs #944 --- kernel/syscall.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/syscall.c b/kernel/syscall.c index c6d9646f..3fb1af25 100644 --- a/kernel/syscall.c +++ b/kernel/syscall.c @@ -10029,8 +10029,10 @@ long syscall(int num, ihk_mc_user_context_t *ctx) } #endif /* POSTK_DEBUG_TEMP_FIX_60 && POSTK_DEBUG_TEMP_FIX_56 */ - if (cpu_local_var(current)->proc->ptrace) { + if (cpu_local_var(current)->proc->ptrace && l != -ENOSYS) { + ihk_mc_syscall_ret(ctx) = l; ptrace_syscall_exit(cpu_local_var(current)); + l = ihk_mc_syscall_ret(ctx); } #ifdef DISABLE_SCHED_YIELD