ptrace: do_notify_parent_cldstop: fix the wrong ->nsproxy usage

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Thursday, June 18, 2009 - 3:00 pm

Gitweb:     http://git.kernel.org/linus/d92656633b8352c6d4b14afcb7beb154d76e7aa6
Commit:     d92656633b8352c6d4b14afcb7beb154d76e7aa6
Parent:     d1e98f429aa10132b3010ba3b0be47552a2eb14b
Author:     Oleg Nesterov <oleg@redhat.com>
AuthorDate: Wed Jun 17 16:27:35 2009 -0700
Committer:  Linus Torvalds <torvalds@linux-foundation.org>
CommitDate: Thu Jun 18 13:03:52 2009 -0700

    ptrace: do_notify_parent_cldstop: fix the wrong ->nsproxy usage
    
    If the non-traced sub-thread calls do_notify_parent_cldstop(), we send the
    notification to group_leader->real_parent and we report group_leader's
    pid.
    
    But, if group_leader is traced we use the wrong ->parent->nsproxy->pid_ns,
    the tracer and parent can live in different namespaces.  Change the code
    to use "parent" instead of tsk->parent.
    
    Signed-off-by: Oleg Nesterov <oleg@redhat.com>
    Acked-by: Roland McGrath <roland@redhat.com>
    Acked-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---
 kernel/signal.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/signal.c b/kernel/signal.c
index 09ccc1c..ccf1cee 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -1499,7 +1499,7 @@ static void do_notify_parent_cldstop(struct task_struct *tsk, int why)
 	 * see comment in do_notify_parent() abot the following 3 lines
 	 */
 	rcu_read_lock();
-	info.si_pid = task_pid_nr_ns(tsk, tsk->parent->nsproxy->pid_ns);
+	info.si_pid = task_pid_nr_ns(tsk, parent->nsproxy->pid_ns);
 	info.si_uid = __task_cred(tsk)->uid;
 	rcu_read_unlock();
 
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
ptrace: do_notify_parent_cldstop: fix the wrong ->nsproxy ..., Linux Kernel Mailing ..., (Thu Jun 18, 3:00 pm)