[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070125150542.GA27472@sergelap.austin.ibm.com>
Date: Thu, 25 Jan 2007 09:05:42 -0600
From: "Serge E. Hallyn" <serue@...ibm.com>
To: linux-kernel@...r.kernel.org
Cc: "Eric W. Biederman" <ebiederm@...ssion.com>,
Cedric Le Goater <clg@...ibm.com>,
Oleg Nesterov <oleg@...sign.ru>,
Daniel Hokka Zakrisson <daniel@...ac.com>,
herbert@...hfloor.at, akpm@...l.org, trond.myklebust@....uio.no,
Linux Containers <containers@...ts.osdl.org>
Subject: [PATCH] namespaces: fix race at task exit
In do_exit(), the exit_task_namespaces() was placed after
exit_notify() because exit_notify ends up using the pid
namespace both to access the reaper, and for detaching the
pid. However, this placement allows an nfs server to reap
the task before exit_task_namespaces() completes.
This patch moves the exit_task_namespaces() into release_task,
below release_thread() which puts the pids(), and just above
the call_rcu(delayed_put_task_struct). I believe this should
solve both problems.
Signed-off-by: Serge E. Hallyn <serue@...ibm.com>
---
kernel/exit.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
765277a4170d7bbd1c4613de661ec6ac64d5580a
diff --git a/kernel/exit.c b/kernel/exit.c
index 3540172..ab9ae30 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -174,6 +174,7 @@ repeat:
write_unlock_irq(&tasklist_lock);
proc_flush_task(p);
release_thread(p);
+ exit_task_namespaces(p);
call_rcu(&p->rcu, delayed_put_task_struct);
p = leader;
@@ -939,7 +940,6 @@ fastcall NORET_TYPE void do_exit(long co
tsk->exit_code = code;
proc_exit_connector(tsk);
exit_notify(tsk);
- exit_task_namespaces(tsk);
#ifdef CONFIG_NUMA
mpol_free(tsk->mempolicy);
tsk->mempolicy = NULL;
--
1.1.6
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists