--- linux-2.4.21-rc2/kernel/fork.c +++ linux-2.4.21-rc2-bk1/kernel/fork.c @@ -572,21 +572,13 @@ unsigned old_task_dumpable; long ret; - /* lock out any potential ptracer */ - task_lock(task); - if (task->ptrace) { - task_unlock(task); - return -EPERM; - } - - old_task_dumpable = task->task_dumpable; + /* lock out any potential ptracer for the new task_struct copy */ task->task_dumpable = 0; - task_unlock(task); ret = arch_kernel_thread(fn, arg, flags); /* never reached in child process, only in parent */ - current->task_dumpable = old_task_dumpable; + task->task_dumpable = old_task_dumpable; return ret; }