From fab413a334a7b3dd2688c5cd5d4718476e430ea4 Mon Sep 17 00:00:00 2001 From: Cedric Le Goater Date: Mon, 2 Oct 2006 02:18:09 -0700 Subject: [PATCH] namespaces: exit_task_namespaces() invalidates nsproxy exit_task_namespaces() has replaced the former exit_namespace(). It invalidates task->nsproxy and associated namespaces. This is an issue for the (futur) pid namespace which is required to be valid in exit_notify(). This patch moves exit_task_namespaces() after exit_notify() to keep nsproxy valid. Signed-off-by: Cedric Le Goater Cc: Serge E. Hallyn Cc: Kirill Korotaev Cc: "Eric W. Biederman" Cc: Herbert Poetzl Cc: Andrey Savochkin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- kernel/exit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kernel') diff --git a/kernel/exit.c b/kernel/exit.c index 741bbe42dfe..f250a5e3e28 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -920,7 +920,6 @@ fastcall NORET_TYPE void do_exit(long code) exit_sem(tsk); __exit_files(tsk); __exit_fs(tsk); - exit_task_namespaces(tsk); exit_thread(); cpuset_exit(tsk); exit_keys(tsk); @@ -935,6 +934,7 @@ fastcall NORET_TYPE void do_exit(long code) 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; -- cgit v1.2.3