]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/ptrace.c
[PATCH] fork.c: proc_fork_connector() called under write_lock()
[linux-2.6-omap-h63xx.git] / kernel / ptrace.c
index 5b8dd98a230e442c1ec46adc968acb60dfdb74ae..17ee7e5a34516f7485250b7a7ef94546907f9b39 100644 (file)
@@ -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)
@@ -470,7 +470,7 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
 
        if (request == PTRACE_ATTACH) {
                ret = ptrace_attach(child);
-               goto out;
+               goto out_put_task_struct;
        }
 
        ret = ptrace_check_attach(child, request == PTRACE_KILL);