fix: bug for ptrace_attach self pid

This commit is contained in:
Ken Sato
2018-03-01 09:37:12 +09:00
parent 1796c20b88
commit 7ad6f9595c

View File

@@ -6088,6 +6088,13 @@ static int ptrace_attach(int pid)
error = -ESRCH;
goto out;
}
if (proc->pid == pid) {
thread_unlock(thread, &lock);
error = -EPERM;
goto out;
}
child = thread->proc;
dkprintf("ptrace_attach(): pid requested:%d, thread->tid:%d, thread->proc->pid=%d, thread->proc->parent=%p\n", pid, thread->tid, thread->proc->pid, thread->proc->parent);