diff --git a/kernel/ptrace.c b/kernel/ptrace.c index 5b8dd98a230e442c1ec46adc968acb60dfdb74ae..b88d4186cd7ac2733c3adf231d5b4daa4e14b0a9 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c @@ -155,7 +155,7 @@ int ptrace_attach(struct task_struct *task) retval = -EPERM; if (task->pid <= 1) goto bad; - if (task == current) + if (task->tgid == current->tgid) goto bad; /* the same process cannot be attached many times */ if (task->ptrace & PT_PTRACED)