Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c0c0b649d67aa775aa9851de61aade17504be70c
Commit:     c0c0b649d67aa775aa9851de61aade17504be70c
Parent:     34a1738f7da0b3d28d4b066d03a78f46b8cab68f
Author:     Oleg Nesterov <[EMAIL PROTECTED]>
AuthorDate: Fri Feb 8 04:19:00 2008 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Fri Feb 8 09:22:26 2008 -0800

    ptrace_check_attach: remove unneeded ->signal != NULL check
    
    It is not possible to see the PT_PTRACED task without ->signal/sighand under
    tasklist_lock, release_task() does ptrace_unlink() first.  If the task was
    already released before, ptrace_attach() can't succeed and set PT_PTRACED.
    Remove this check.
    
    Signed-off-by: Oleg Nesterov <[EMAIL PROTECTED]>
    Acked-by: Roland McGrath <[EMAIL PROTECTED]>
    Cc: Christoph Hellwig <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 kernel/ptrace.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 2dc0029..fdb34e8 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -99,9 +99,12 @@ int ptrace_check_attach(struct task_struct *child, int kill)
         * be changed by us so it's not changing right after this.
         */
        read_lock(&tasklist_lock);
-       if ((child->ptrace & PT_PTRACED) && child->parent == current &&
-            child->signal != NULL) {
+       if ((child->ptrace & PT_PTRACED) && child->parent == current) {
                ret = 0;
+               /*
+                * child->sighand can't be NULL, release_task()
+                * does ptrace_unlink() before __exit_signal().
+                */
                spin_lock_irq(&child->sighand->siglock);
                if (task_is_stopped(child))
                        child->state = TASK_TRACED;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to