[patch] Fix -EPERM returned by kernel_thead() if traced...

From: Chuck Ebbert (76306.1226@compuserve.com)
Date: Mon May 12 2003 - 20:57:30 EST


Bernhard Kaindl wrote:

> - task_lock(task);
> - if (task->ptrace) {
> - task_unlock(task);
> - return -EPERM;
> - }
> -
> old_task_dumpable = task->task_dumpable;
> + /* prevent ptrace_attach() on the new task: */
> task->task_dumpable = 0;
> - task_unlock(task);

  Is it safe to remove the task_lock()?

> So I really have to assume that CLONE_PTRACE is never passed
> to create a kernel thread. If you are paranoid, you could just
> unmask it in kernel_thread() if you want.

  I would mask it if it's a possible problem. Someone might
try to pass that option in future code...

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu May 15 2003 - 22:00:43 EST