[<prev] [next>] [day] [month] [year] [list]
Message-ID: <47270897.4000409@fr.ibm.com>
Date: Tue, 30 Oct 2007 11:33:59 +0100
From: Daniel Lezcano <dlezcano@...ibm.com>
To: David Miller <davem@...emloft.net>,
"Eric W. Biederman" <ebiederm@...ssion.com>
CC: Linux Netdev List <netdev@...r.kernel.org>,
Linux Containers <containers@...ts.osdl.org>
Subject: [PATCH][NETNS] fix net released by rcu callback
When a network namespace reference is held by a network subsystem,
and when this reference is decremented in a rcu update callback, we
must ensure that there is no more outstanding rcu update before
trying to free the network namespace.
In the normal case, the rcu_barrier is called when the network namespace
is exiting in the cleanup_net function.
But when a network namespace creation fails, and the subsystems are
undone (like the cleanup), the rcu_barrier is missing.
This patch adds the missing rcu_barrier.
Signed-off-by: Daniel Lezcano <dlezcano@...ibm.com>
---
net/core/net_namespace.c | 2 ++
1 file changed, 2 insertions(+)
Index: net-2.6/net/core/net_namespace.c
===================================================================
--- net-2.6.orig/net/core/net_namespace.c
+++ net-2.6/net/core/net_namespace.c
@@ -112,6 +112,8 @@ out_undo:
if (ops->exit)
ops->exit(net);
}
+
+ rcu_barrier();
goto out;
}
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists