From 0f8b2aba22b8df08b9d23e0d6fe863f6dcd50e6c Mon Sep 17 00:00:00 2001 From: Tomoki Shirasawa Date: Fri, 18 Dec 2015 12:46:53 +0900 Subject: [PATCH] reset signal handlers when execve called --- kernel/syscall.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kernel/syscall.c b/kernel/syscall.c index 98b9abf7..4916427f 100644 --- a/kernel/syscall.c +++ b/kernel/syscall.c @@ -1688,6 +1688,7 @@ SYSCALL_DECLARE(execve) struct process_vm *vm = thread->vm; struct vm_range *range; struct process *proc = thread->proc; + int i; ihk_mc_spinlock_lock_noirq(&vm->memory_range_lock); @@ -1786,6 +1787,12 @@ SYSCALL_DECLARE(execve) panic(""); } + for(i = 0; i < _NSIG; i++){ + if(thread->sigcommon->action[i].sa.sa_handler != SIG_IGN && + thread->sigcommon->action[i].sa.sa_handler != SIG_DFL) + thread->sigcommon->action[i].sa.sa_handler = SIG_DFL; + } + error = ptrace_report_exec(cpu_local_var(current)); if(error) { kprintf("execve(): ERROR: ptrace_report_exec()\n");