fix: bug for ptrace_attach self pid
This commit is contained in:
@@ -6088,6 +6088,13 @@ static int ptrace_attach(int pid)
|
|||||||
error = -ESRCH;
|
error = -ESRCH;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (proc->pid == pid) {
|
||||||
|
thread_unlock(thread, &lock);
|
||||||
|
error = -EPERM;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
child = thread->proc;
|
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);
|
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);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user