Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0f2452855d86901ba3766826ccb5606ea4e15ab9
Commit:     0f2452855d86901ba3766826ccb5606ea4e15ab9
Parent:     444f378b237a0f728f5c4aba752c08d13c209344
Author:     Serge E. Hallyn <[EMAIL PROTECTED]>
AuthorDate: Tue Jan 30 15:28:23 2007 -0600
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue Jan 30 13:40:36 2007 -0800

    [PATCH] namespaces: fix task exit disaster
    
    This is based on a patch by Eric W.  Biederman, who pointed out that pid
    namespaces are still fake, and we only have one ever active.
    
    So for the time being, we can modify any code which could access
    tsk->nsproxy->pid_ns during task exit to just use &init_pid_ns instead,
    and move the exit_task_namespaces call in do_exit() back above
    exit_notify(), so that an exiting nfs server has a valid tsk->sighand to
    work with.
    
    Long term, pulling pid_ns out of nsproxy might be the cleanest solution.
    
    Signed-off-by: Eric W. Biederman <[EMAIL PROTECTED]>
    
    [ Eric's patch fixed to take care of free_pid() too ]
    
    Signed-off-by: Serge E. Hallyn <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 include/linux/pid_namespace.h |    2 +-
 kernel/exit.c                 |    2 +-
 kernel/pid.c                  |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h
index d2a9d41..2833806 100644
--- a/include/linux/pid_namespace.h
+++ b/include/linux/pid_namespace.h
@@ -39,7 +39,7 @@ static inline void put_pid_ns(struct pid_namespace *ns)
 
 static inline struct task_struct *child_reaper(struct task_struct *tsk)
 {
-       return tsk->nsproxy->pid_ns->child_reaper;
+       return init_pid_ns.child_reaper;
 }
 
 #endif /* _LINUX_PID_NS_H */
diff --git a/kernel/exit.c b/kernel/exit.c
index 3540172..fec12eb 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -938,8 +938,8 @@ fastcall NORET_TYPE void do_exit(long code)
 
        tsk->exit_code = code;
        proc_exit_connector(tsk);
-       exit_notify(tsk);
        exit_task_namespaces(tsk);
+       exit_notify(tsk);
 #ifdef CONFIG_NUMA
        mpol_free(tsk->mempolicy);
        tsk->mempolicy = NULL;
diff --git a/kernel/pid.c b/kernel/pid.c
index 2efe9d8..78f2aee 100644
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -197,7 +197,7 @@ fastcall void free_pid(struct pid *pid)
        hlist_del_rcu(&pid->pid_chain);
        spin_unlock_irqrestore(&pidmap_lock, flags);
 
-       free_pidmap(current->nsproxy->pid_ns, pid->nr);
+       free_pidmap(&init_pid_ns, pid->nr);
        call_rcu(&pid->rcu, delayed_put_pid);
 }
 
-
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