From 0909a5bed5b014d71f91c84407e3d609763eff02 Mon Sep 17 00:00:00 2001 From: Tomoki Shirasawa Date: Thu, 3 Sep 2015 10:05:25 +0900 Subject: [PATCH] tracee context is broken when tracee call execve --- kernel/syscall.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/syscall.c b/kernel/syscall.c index 7bd1674b..a3b971e1 100644 --- a/kernel/syscall.c +++ b/kernel/syscall.c @@ -1569,8 +1569,12 @@ static int ptrace_report_exec(struct process *proc) int ptrace = proc->ftn->ptrace; if (ptrace & (PT_TRACE_EXEC|PTRACE_O_TRACEEXEC)) { + ihk_mc_kernel_context_t ctx; int sig = (SIGTRAP | (PTRACE_EVENT_EXEC << 8)); + + memcpy(&ctx, &proc->ctx, sizeof ctx); ptrace_report_signal(proc, sig); + memcpy(&proc->ctx, &ctx, sizeof ctx); } return 0; }