]> err.no Git - linux-2.6/blobdiff - kernel/ptrace.c
deny partial write for loop dev fd
[linux-2.6] / kernel / ptrace.c
index 4a1745f1dadf28c93cad33eadc135d8190912462..0870523c2ae40125c15ccb35a9542f0116939f4d 100644 (file)
@@ -142,7 +142,7 @@ static int may_attach(struct task_struct *task)
                return -EPERM;
        smp_rmb();
        if (task->mm)
-               dumpable = task->mm->dumpable;
+               dumpable = get_dumpable(task->mm);
        if (!dumpable && !capable(CAP_SYS_PTRACE))
                return -EPERM;
 
@@ -233,6 +233,7 @@ int ptrace_detach(struct task_struct *child, unsigned int data)
 
        /* Architecture-specific hardware disable .. */
        ptrace_disable(child);
+       clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
 
        write_lock_irq(&tasklist_lock);
        /* protect against de_thread()->release_task() */
@@ -385,6 +386,9 @@ int ptrace_request(struct task_struct *child, long request,
        case PTRACE_SETSIGINFO:
                ret = ptrace_setsiginfo(child, (siginfo_t __user *) data);
                break;
+       case PTRACE_DETACH:      /* detach a process that was attached. */
+               ret = ptrace_detach(child, data);
+               break;
        default:
                break;
        }