All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/4] netns: enhance netlink interface for nsid
@ 2015-04-01 12:49 Nicolas Dichtel
  2015-04-01 12:49 ` [PATCH net-next 1/4] netns: don't clear nsid too early on removal Nicolas Dichtel
                   ` (5 more replies)
  0 siblings, 6 replies; 21+ messages in thread
From: Nicolas Dichtel @ 2015-04-01 12:49 UTC (permalink / raw)
  To: netdev; +Cc: davem, ebiederm


The first patch has been cherry-picked from the net tree to avoid any conflict
later.

The second patch is a small cleanup. The third patch implements notifications
for netns id events. And the last one allows to dump existing netns id from
userland.

iproute2 patches are available, I can send them on demand.

The diffstat does not include the first patch.

 include/uapi/linux/rtnetlink.h |   4 ++
 net/core/net_namespace.c       | 103 +++++++++++++++++++++++++++++++++++++----
 2 files changed, 97 insertions(+), 10 deletions(-)

Comments are welcome.

Regards,
Nicolas

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH net-next 1/4] netns: don't clear nsid too early on removal
  2015-04-01 12:49 [PATCH net-next 0/4] netns: enhance netlink interface for nsid Nicolas Dichtel
@ 2015-04-01 12:49 ` Nicolas Dichtel
  2015-04-02 18:51   ` Eric W. Biederman
  2015-04-01 12:49 ` [PATCH net-next 2/4] netns: minor cleanup in rtnl_net_getid() Nicolas Dichtel
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 21+ messages in thread
From: Nicolas Dichtel @ 2015-04-01 12:49 UTC (permalink / raw)
  To: netdev; +Cc: davem, ebiederm, Nicolas Dichtel

With the current code, ids are removed too early.
Suppose you have an ipip interface that stands in the netns foo and its link
part in the netns bar (so the netns bar has an nsid into the netns foo).
Now, you remove the netns bar:
 - the bar nsid into the netns foo is removed
 - the netns exit method of ipip is called, thus our ipip iface is removed:
   => a netlink message is sent in the netns foo to advertise this deletion
   => this netlink message requests an nsid for bar, thus a new nsid is
      allocated for bar and never removed.

We must remove nsids when we are sure that nobody will refer to netns currently
cleaned.

Fixes: 0c7aecd4bde4 ("netns: add rtnl cmd to add and get peer netns ids")
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 4217291e592da0e4258b652e82e5428639d29acc)
---

This patch comes from the net tree.

 net/core/net_namespace.c | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index e5e96b0f6717..ce6396a75b8b 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -338,7 +338,7 @@ static LIST_HEAD(cleanup_list);  /* Must hold cleanup_list_lock to touch */
 static void cleanup_net(struct work_struct *work)
 {
 	const struct pernet_operations *ops;
-	struct net *net, *tmp;
+	struct net *net, *tmp, *peer;
 	struct list_head net_kill_list;
 	LIST_HEAD(net_exit_list);
 
@@ -354,14 +354,6 @@ static void cleanup_net(struct work_struct *work)
 	list_for_each_entry(net, &net_kill_list, cleanup_list) {
 		list_del_rcu(&net->list);
 		list_add_tail(&net->exit_list, &net_exit_list);
-		for_each_net(tmp) {
-			int id = __peernet2id(tmp, net, false);
-
-			if (id >= 0)
-				idr_remove(&tmp->netns_ids, id);
-		}
-		idr_destroy(&net->netns_ids);
-
 	}
 	rtnl_unlock();
 
@@ -387,12 +379,26 @@ static void cleanup_net(struct work_struct *work)
 	 */
 	rcu_barrier();
 
+	rtnl_lock();
 	/* Finally it is safe to free my network namespace structure */
 	list_for_each_entry_safe(net, tmp, &net_exit_list, exit_list) {
+		/* Unreference net from all peers (no need to loop over
+		 * net_exit_list because idr_destroy() will be called for each
+		 * element of this list.
+		 */
+		for_each_net(peer) {
+			int id = __peernet2id(peer, net, false);
+
+			if (id >= 0)
+				idr_remove(&peer->netns_ids, id);
+		}
+		idr_destroy(&net->netns_ids);
+
 		list_del_init(&net->exit_list);
 		put_user_ns(net->user_ns);
 		net_drop_ns(net);
 	}
+	rtnl_unlock();
 }
 static DECLARE_WORK(net_cleanup_work, cleanup_net);
 
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next 2/4] netns: minor cleanup in rtnl_net_getid()
  2015-04-01 12:49 [PATCH net-next 0/4] netns: enhance netlink interface for nsid Nicolas Dichtel
  2015-04-01 12:49 ` [PATCH net-next 1/4] netns: don't clear nsid too early on removal Nicolas Dichtel
@ 2015-04-01 12:49 ` Nicolas Dichtel
  2015-04-01 12:49 ` [PATCH net-next 3/4] netns: notify netns id events Nicolas Dichtel
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 21+ messages in thread
From: Nicolas Dichtel @ 2015-04-01 12:49 UTC (permalink / raw)
  To: netdev; +Cc: davem, ebiederm, Nicolas Dichtel

No need to initialize err, it will be overridden by the value of nlmsg_parse().

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 net/core/net_namespace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index ce6396a75b8b..6c770be87f1f 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -569,8 +569,8 @@ static int rtnl_net_getid(struct sk_buff *skb, struct nlmsghdr *nlh)
 	struct net *net = sock_net(skb->sk);
 	struct nlattr *tb[NETNSA_MAX + 1];
 	struct sk_buff *msg;
-	int err = -ENOBUFS;
 	struct net *peer;
+	int err;
 
 	err = nlmsg_parse(nlh, sizeof(struct rtgenmsg), tb, NETNSA_MAX,
 			  rtnl_net_policy);
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next 3/4] netns: notify netns id events
  2015-04-01 12:49 [PATCH net-next 0/4] netns: enhance netlink interface for nsid Nicolas Dichtel
  2015-04-01 12:49 ` [PATCH net-next 1/4] netns: don't clear nsid too early on removal Nicolas Dichtel
  2015-04-01 12:49 ` [PATCH net-next 2/4] netns: minor cleanup in rtnl_net_getid() Nicolas Dichtel
@ 2015-04-01 12:49 ` Nicolas Dichtel
  2015-04-01 12:49 ` [PATCH net-next 4/4] netns: allow to dump netns ids Nicolas Dichtel
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 21+ messages in thread
From: Nicolas Dichtel @ 2015-04-01 12:49 UTC (permalink / raw)
  To: netdev; +Cc: davem, ebiederm, Nicolas Dichtel

With this patch, netns ids that are created and deleted are advertised into the
group RTNLGRP_NSID.

Because callers of rtnl_net_notifyid() already know the id of the peer, there is
no need to call __peernet2id() in rtnl_net_fill().

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 include/uapi/linux/rtnetlink.h |  4 ++++
 net/core/net_namespace.c       | 52 +++++++++++++++++++++++++++++++++++-------
 2 files changed, 48 insertions(+), 8 deletions(-)

diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h
index bea910f924dd..974db03f7b1a 100644
--- a/include/uapi/linux/rtnetlink.h
+++ b/include/uapi/linux/rtnetlink.h
@@ -134,6 +134,8 @@ enum {
 
 	RTM_NEWNSID = 88,
 #define RTM_NEWNSID RTM_NEWNSID
+	RTM_DELNSID = 89,
+#define RTM_DELNSID RTM_DELNSID
 	RTM_GETNSID = 90,
 #define RTM_GETNSID RTM_GETNSID
 
@@ -635,6 +637,8 @@ enum rtnetlink_groups {
 #define RTNLGRP_MDB		RTNLGRP_MDB
 	RTNLGRP_MPLS_ROUTE,
 #define RTNLGRP_MPLS_ROUTE	RTNLGRP_MPLS_ROUTE
+	RTNLGRP_NSID,
+#define RTNLGRP_NSID		RTNLGRP_NSID
 	__RTNLGRP_MAX
 };
 #define RTNLGRP_MAX	(__RTNLGRP_MAX - 1)
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 6c770be87f1f..bfe44c328ec2 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -148,9 +148,11 @@ static void ops_free_list(const struct pernet_operations *ops,
 	}
 }
 
+static void rtnl_net_notifyid(struct net *net, struct net *peer, int cmd,
+			      int id);
 static int alloc_netid(struct net *net, struct net *peer, int reqid)
 {
-	int min = 0, max = 0;
+	int min = 0, max = 0, id;
 
 	ASSERT_RTNL();
 
@@ -159,7 +161,11 @@ static int alloc_netid(struct net *net, struct net *peer, int reqid)
 		max = reqid + 1;
 	}
 
-	return idr_alloc(&net->netns_ids, peer, min, max, GFP_KERNEL);
+	id = idr_alloc(&net->netns_ids, peer, min, max, GFP_KERNEL);
+	if (id >= 0)
+		rtnl_net_notifyid(net, peer, RTM_NEWNSID, id);
+
+	return id;
 }
 
 /* This function is used by idr_for_each(). If net is equal to peer, the
@@ -389,8 +395,10 @@ static void cleanup_net(struct work_struct *work)
 		for_each_net(peer) {
 			int id = __peernet2id(peer, net, false);
 
-			if (id >= 0)
+			if (id >= 0) {
+				rtnl_net_notifyid(peer, net, RTM_DELNSID, id);
 				idr_remove(&peer->netns_ids, id);
+			}
 		}
 		idr_destroy(&net->netns_ids);
 
@@ -535,7 +543,8 @@ static int rtnl_net_get_size(void)
 }
 
 static int rtnl_net_fill(struct sk_buff *skb, u32 portid, u32 seq, int flags,
-			 int cmd, struct net *net, struct net *peer)
+			 int cmd, struct net *net, struct net *peer,
+			 int nsid)
 {
 	struct nlmsghdr *nlh;
 	struct rtgenmsg *rth;
@@ -550,9 +559,13 @@ static int rtnl_net_fill(struct sk_buff *skb, u32 portid, u32 seq, int flags,
 	rth = nlmsg_data(nlh);
 	rth->rtgen_family = AF_UNSPEC;
 
-	id = __peernet2id(net, peer, false);
-	if  (id < 0)
-		id = NETNSA_NSID_NOT_ASSIGNED;
+	if (nsid >= 0) {
+		id = nsid;
+	} else {
+		id = __peernet2id(net, peer, false);
+		if  (id < 0)
+			id = NETNSA_NSID_NOT_ASSIGNED;
+	}
 	if (nla_put_s32(skb, NETNSA_NSID, id))
 		goto nla_put_failure;
 
@@ -593,7 +606,7 @@ static int rtnl_net_getid(struct sk_buff *skb, struct nlmsghdr *nlh)
 	}
 
 	err = rtnl_net_fill(msg, NETLINK_CB(skb).portid, nlh->nlmsg_seq, 0,
-			    RTM_GETNSID, net, peer);
+			    RTM_GETNSID, net, peer, -1);
 	if (err < 0)
 		goto err_out;
 
@@ -607,6 +620,29 @@ out:
 	return err;
 }
 
+static void rtnl_net_notifyid(struct net *net, struct net *peer, int cmd,
+			      int id)
+{
+	struct sk_buff *msg;
+	int err = -ENOMEM;
+
+	msg = nlmsg_new(rtnl_net_get_size(), GFP_KERNEL);
+	if (!msg)
+		goto out;
+
+	err = rtnl_net_fill(msg, 0, 0, 0, cmd, net, peer, id);
+	if (err < 0)
+		goto err_out;
+
+	rtnl_notify(msg, net, 0, RTNLGRP_NSID, NULL, 0);
+	return;
+
+err_out:
+	nlmsg_free(msg);
+out:
+	rtnl_set_sk_err(net, RTNLGRP_NSID, err);
+}
+
 static int __init net_ns_init(void)
 {
 	struct net_generic *ng;
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next 4/4] netns: allow to dump netns ids
  2015-04-01 12:49 [PATCH net-next 0/4] netns: enhance netlink interface for nsid Nicolas Dichtel
                   ` (2 preceding siblings ...)
  2015-04-01 12:49 ` [PATCH net-next 3/4] netns: notify netns id events Nicolas Dichtel
@ 2015-04-01 12:49 ` Nicolas Dichtel
  2015-04-01 16:54 ` [PATCH net-next 0/4] netns: enhance netlink interface for nsid Cong Wang
  2015-04-07  9:51 ` [PATCH net-next v2 0/3] " Nicolas Dichtel
  5 siblings, 0 replies; 21+ messages in thread
From: Nicolas Dichtel @ 2015-04-01 12:49 UTC (permalink / raw)
  To: netdev; +Cc: davem, ebiederm, Nicolas Dichtel

Which this patch, it's possible to dump the list of ids allocated for peer
netns.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 net/core/net_namespace.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 48 insertions(+), 1 deletion(-)

diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index bfe44c328ec2..19630538c16d 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -620,6 +620,52 @@ out:
 	return err;
 }
 
+struct rtnl_net_dump_cb {
+	struct net *net;
+	struct sk_buff *skb;
+	struct netlink_callback *cb;
+	int idx;
+	int s_idx;
+};
+
+static int rtnl_net_dumpid_one(int id, void *peer, void *data)
+{
+	struct rtnl_net_dump_cb *net_cb = (struct rtnl_net_dump_cb *)data;
+	int ret;
+
+	if (net_cb->idx < net_cb->s_idx)
+		goto cont;
+
+	ret = rtnl_net_fill(net_cb->skb, NETLINK_CB(net_cb->cb->skb).portid,
+			    net_cb->cb->nlh->nlmsg_seq, NLM_F_MULTI,
+			    RTM_NEWNSID, net_cb->net, peer, id);
+	if (ret < 0)
+		return ret;
+
+cont:
+	net_cb->idx++;
+	return 0;
+}
+
+static int rtnl_net_dumpid(struct sk_buff *skb, struct netlink_callback *cb)
+{
+	struct net *net = sock_net(skb->sk);
+	struct rtnl_net_dump_cb net_cb = {
+		.net = net,
+		.skb = skb,
+		.cb = cb,
+		.idx = 0,
+		.s_idx = cb->args[0],
+	};
+
+	ASSERT_RTNL();
+
+	idr_for_each(&net->netns_ids, rtnl_net_dumpid_one, &net_cb);
+
+	cb->args[0] = net_cb.idx;
+	return skb->len;
+}
+
 static void rtnl_net_notifyid(struct net *net, struct net *peer, int cmd,
 			      int id)
 {
@@ -677,7 +723,8 @@ static int __init net_ns_init(void)
 	register_pernet_subsys(&net_ns_ops);
 
 	rtnl_register(PF_UNSPEC, RTM_NEWNSID, rtnl_net_newid, NULL, NULL);
-	rtnl_register(PF_UNSPEC, RTM_GETNSID, rtnl_net_getid, NULL, NULL);
+	rtnl_register(PF_UNSPEC, RTM_GETNSID, rtnl_net_getid, rtnl_net_dumpid,
+		      NULL);
 
 	return 0;
 }
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next 0/4] netns: enhance netlink interface for nsid
  2015-04-01 12:49 [PATCH net-next 0/4] netns: enhance netlink interface for nsid Nicolas Dichtel
                   ` (3 preceding siblings ...)
  2015-04-01 12:49 ` [PATCH net-next 4/4] netns: allow to dump netns ids Nicolas Dichtel
@ 2015-04-01 16:54 ` Cong Wang
  2015-04-02  8:52   ` Nicolas Dichtel
  2015-04-07  9:51 ` [PATCH net-next v2 0/3] " Nicolas Dichtel
  5 siblings, 1 reply; 21+ messages in thread
From: Cong Wang @ 2015-04-01 16:54 UTC (permalink / raw)
  To: Nicolas Dichtel; +Cc: netdev, David Miller, Eric W. Biederman

On Wed, Apr 1, 2015 at 5:49 AM, Nicolas Dichtel
<nicolas.dichtel@6wind.com> wrote:
>
> The first patch has been cherry-picked from the net tree to avoid any conflict
> later.
>

You don't need to cherry-pick, you just need to wait for net merged
into net-next,
or simply tell DaveM your patches apply after the merge.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next 0/4] netns: enhance netlink interface for nsid
  2015-04-01 16:54 ` [PATCH net-next 0/4] netns: enhance netlink interface for nsid Cong Wang
@ 2015-04-02  8:52   ` Nicolas Dichtel
  0 siblings, 0 replies; 21+ messages in thread
From: Nicolas Dichtel @ 2015-04-02  8:52 UTC (permalink / raw)
  To: Cong Wang; +Cc: netdev, David Miller, Eric W. Biederman

Le 01/04/2015 18:54, Cong Wang a écrit :
> On Wed, Apr 1, 2015 at 5:49 AM, Nicolas Dichtel
> <nicolas.dichtel@6wind.com> wrote:
>>
>> The first patch has been cherry-picked from the net tree to avoid any conflict
>> later.
>>
>
> You don't need to cherry-pick, you just need to wait for net merged
> into net-next,
> or simply tell DaveM your patches apply after the merge.
In fact, the goal of the cherry-pick was to inform David of that dependency. I
didn't expect him to include this patch in net-next ;-)

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next 1/4] netns: don't clear nsid too early on removal
  2015-04-01 12:49 ` [PATCH net-next 1/4] netns: don't clear nsid too early on removal Nicolas Dichtel
@ 2015-04-02 18:51   ` Eric W. Biederman
  2015-04-03  9:56     ` Nicolas Dichtel
  0 siblings, 1 reply; 21+ messages in thread
From: Eric W. Biederman @ 2015-04-02 18:51 UTC (permalink / raw)
  To: Nicolas Dichtel; +Cc: netdev, davem

Nicolas Dichtel <nicolas.dichtel@6wind.com> writes:

> With the current code, ids are removed too early.
> Suppose you have an ipip interface that stands in the netns foo and its link
> part in the netns bar (so the netns bar has an nsid into the netns foo).
> Now, you remove the netns bar:
>  - the bar nsid into the netns foo is removed
>  - the netns exit method of ipip is called, thus our ipip iface is removed:
>    => a netlink message is sent in the netns foo to advertise this deletion
>    => this netlink message requests an nsid for bar, thus a new nsid is
>       allocated for bar and never removed.
>
> We must remove nsids when we are sure that nobody will refer to netns currently
> cleaned.

I missed this issue but I have grave reservations about moving this
destruction of ids later.

It should not be possible to find by any kind of lookup network
namespaces that are going through cleanup net.

There should be no network sockets and thus no in flight rtnl traffic at
the time cleanup_net is metioned so I don't see how this patch fixes
the mentioned commit.

I have a second issue with the fact that the code is unnecessarily
quadratic.  We should keep a list of the issues netns ids and just
revoke them instead of walking the whole network namespaces.

I strongly suspect that this change makes it possible to create a
network device whose bottom is in a network namespace we are destroying
after we have destroyed all of the network devices in that namespace and
otherwise cleaned up.   Beyond that I can not reason about this patch
because it opens up a huge number of races.

> Fixes: 0c7aecd4bde4 ("netns: add rtnl cmd to add and get peer netns ids")
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> (cherry picked from commit 4217291e592da0e4258b652e82e5428639d29acc)
> ---
>
> This patch comes from the net tree.
>
>  net/core/net_namespace.c | 24 +++++++++++++++---------
>  1 file changed, 15 insertions(+), 9 deletions(-)
>
> diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
> index e5e96b0f6717..ce6396a75b8b 100644
> --- a/net/core/net_namespace.c
> +++ b/net/core/net_namespace.c
> @@ -338,7 +338,7 @@ static LIST_HEAD(cleanup_list);  /* Must hold cleanup_list_lock to touch */
>  static void cleanup_net(struct work_struct *work)
>  {
>  	const struct pernet_operations *ops;
> -	struct net *net, *tmp;
> +	struct net *net, *tmp, *peer;
>  	struct list_head net_kill_list;
>  	LIST_HEAD(net_exit_list);
>  
> @@ -354,14 +354,6 @@ static void cleanup_net(struct work_struct *work)
>  	list_for_each_entry(net, &net_kill_list, cleanup_list) {
>  		list_del_rcu(&net->list);
>  		list_add_tail(&net->exit_list, &net_exit_list);
> -		for_each_net(tmp) {
> -			int id = __peernet2id(tmp, net, false);
> -
> -			if (id >= 0)
> -				idr_remove(&tmp->netns_ids, id);
> -		}
> -		idr_destroy(&net->netns_ids);
> -
>  	}
>  	rtnl_unlock();
>  
> @@ -387,12 +379,26 @@ static void cleanup_net(struct work_struct *work)
>  	 */
>  	rcu_barrier();
>  
> +	rtnl_lock();
>  	/* Finally it is safe to free my network namespace structure */
>  	list_for_each_entry_safe(net, tmp, &net_exit_list, exit_list) {
> +		/* Unreference net from all peers (no need to loop over
> +		 * net_exit_list because idr_destroy() will be called for each
> +		 * element of this list.
> +		 */
> +		for_each_net(peer) {
> +			int id = __peernet2id(peer, net, false);
> +
> +			if (id >= 0)
> +				idr_remove(&peer->netns_ids, id);
> +		}
> +		idr_destroy(&net->netns_ids);
> +
>  		list_del_init(&net->exit_list);
>  		put_user_ns(net->user_ns);
>  		net_drop_ns(net);
>  	}
> +	rtnl_unlock();
>  }
>  static DECLARE_WORK(net_cleanup_work, cleanup_net);

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next 1/4] netns: don't clear nsid too early on removal
  2015-04-02 18:51   ` Eric W. Biederman
@ 2015-04-03  9:56     ` Nicolas Dichtel
  2015-04-03 10:02       ` [PATCH net 1/2] Revert "netns: don't clear nsid too early on removal" Nicolas Dichtel
  0 siblings, 1 reply; 21+ messages in thread
From: Nicolas Dichtel @ 2015-04-03  9:56 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: netdev, davem

Le 02/04/2015 20:51, Eric W. Biederman a écrit :
[snip]
>
> There should be no network sockets and thus no in flight rtnl traffic at
> the time cleanup_net is metioned so I don't see how this patch fixes
> the mentioned commit.
Yes and no.
Yes, there is no network sockets into this netns, *but* modules build
netlink messages because they don't know if there are listeners or not.

>
> I have a second issue with the fact that the code is unnecessarily
> quadratic.  We should keep a list of the issues netns ids and just
> revoke them instead of walking the whole network namespaces.
>
> I strongly suspect that this change makes it possible to create a
> network device whose bottom is in a network namespace we are destroying
> after we have destroyed all of the network devices in that namespace and
> otherwise cleaned up.   Beyond that I can not reason about this patch
> because it opens up a huge number of races.
Ok, you're probably right.
I will send an update.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH net 1/2] Revert "netns: don't clear nsid too early on removal"
  2015-04-03  9:56     ` Nicolas Dichtel
@ 2015-04-03 10:02       ` Nicolas Dichtel
  2015-04-03 10:02         ` [PATCH net 2/2] netns: don't allocate an id for dead netns Nicolas Dichtel
  2015-04-03 16:36         ` [PATCH net 1/2] Revert "netns: don't clear nsid too early on removal" David Miller
  0 siblings, 2 replies; 21+ messages in thread
From: Nicolas Dichtel @ 2015-04-03 10:02 UTC (permalink / raw)
  To: davem; +Cc: netdev, ebiederm, Nicolas Dichtel

This reverts
commit 4217291e592d ("netns: don't clear nsid too early on removal").

This is not the right fix, it introduces races.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 net/core/net_namespace.c | 24 +++++++++---------------
 1 file changed, 9 insertions(+), 15 deletions(-)

diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 5221f975a4cc..cb5290b8c428 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -349,7 +349,7 @@ static LIST_HEAD(cleanup_list);  /* Must hold cleanup_list_lock to touch */
 static void cleanup_net(struct work_struct *work)
 {
 	const struct pernet_operations *ops;
-	struct net *net, *tmp, *peer;
+	struct net *net, *tmp;
 	struct list_head net_kill_list;
 	LIST_HEAD(net_exit_list);
 
@@ -365,6 +365,14 @@ static void cleanup_net(struct work_struct *work)
 	list_for_each_entry(net, &net_kill_list, cleanup_list) {
 		list_del_rcu(&net->list);
 		list_add_tail(&net->exit_list, &net_exit_list);
+		for_each_net(tmp) {
+			int id = __peernet2id(tmp, net, false);
+
+			if (id >= 0)
+				idr_remove(&tmp->netns_ids, id);
+		}
+		idr_destroy(&net->netns_ids);
+
 	}
 	rtnl_unlock();
 
@@ -390,26 +398,12 @@ static void cleanup_net(struct work_struct *work)
 	 */
 	rcu_barrier();
 
-	rtnl_lock();
 	/* Finally it is safe to free my network namespace structure */
 	list_for_each_entry_safe(net, tmp, &net_exit_list, exit_list) {
-		/* Unreference net from all peers (no need to loop over
-		 * net_exit_list because idr_destroy() will be called for each
-		 * element of this list.
-		 */
-		for_each_net(peer) {
-			int id = __peernet2id(peer, net, false);
-
-			if (id >= 0)
-				idr_remove(&peer->netns_ids, id);
-		}
-		idr_destroy(&net->netns_ids);
-
 		list_del_init(&net->exit_list);
 		put_user_ns(net->user_ns);
 		net_drop_ns(net);
 	}
-	rtnl_unlock();
 }
 static DECLARE_WORK(net_cleanup_work, cleanup_net);
 
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net 2/2] netns: don't allocate an id for dead netns
  2015-04-03 10:02       ` [PATCH net 1/2] Revert "netns: don't clear nsid too early on removal" Nicolas Dichtel
@ 2015-04-03 10:02         ` Nicolas Dichtel
  2015-04-03 16:36           ` David Miller
  2015-04-03 16:36         ` [PATCH net 1/2] Revert "netns: don't clear nsid too early on removal" David Miller
  1 sibling, 1 reply; 21+ messages in thread
From: Nicolas Dichtel @ 2015-04-03 10:02 UTC (permalink / raw)
  To: davem; +Cc: netdev, ebiederm, Nicolas Dichtel

First, let's explain the problem.
Suppose you have an ipip interface that stands in the netns foo and its link
part in the netns bar (so the netns bar has an nsid into the netns foo).
Now, you remove the netns bar:
 - the bar nsid into the netns foo is removed
 - the netns exit method of ipip is called, thus our ipip iface is removed:
   => a netlink message is built in the netns foo to advertise this deletion
   => this netlink message requests an nsid for bar, thus a new nsid is
      allocated for bar and never removed.

This patch adds a check in peernet2id() so that an id cannot be allocated for
a netns which is currently destroyed.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 net/core/net_namespace.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index cb5290b8c428..70d3450588b2 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -198,8 +198,10 @@ static int __peernet2id(struct net *net, struct net *peer, bool alloc)
  */
 int peernet2id(struct net *net, struct net *peer)
 {
-	int id = __peernet2id(net, peer, true);
+	bool alloc = atomic_read(&peer->count) == 0 ? false : true;
+	int id;
 
+	id = __peernet2id(net, peer, alloc);
 	return id >= 0 ? id : NETNSA_NSID_NOT_ASSIGNED;
 }
 EXPORT_SYMBOL(peernet2id);
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: [PATCH net 1/2] Revert "netns: don't clear nsid too early on removal"
  2015-04-03 10:02       ` [PATCH net 1/2] Revert "netns: don't clear nsid too early on removal" Nicolas Dichtel
  2015-04-03 10:02         ` [PATCH net 2/2] netns: don't allocate an id for dead netns Nicolas Dichtel
@ 2015-04-03 16:36         ` David Miller
  1 sibling, 0 replies; 21+ messages in thread
From: David Miller @ 2015-04-03 16:36 UTC (permalink / raw)
  To: nicolas.dichtel; +Cc: netdev, ebiederm

From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Fri,  3 Apr 2015 12:02:36 +0200

> This reverts
> commit 4217291e592d ("netns: don't clear nsid too early on removal").
> 
> This is not the right fix, it introduces races.
> 
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>

Applied.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net 2/2] netns: don't allocate an id for dead netns
  2015-04-03 10:02         ` [PATCH net 2/2] netns: don't allocate an id for dead netns Nicolas Dichtel
@ 2015-04-03 16:36           ` David Miller
  2015-04-05  8:39             ` Nicolas Dichtel
  0 siblings, 1 reply; 21+ messages in thread
From: David Miller @ 2015-04-03 16:36 UTC (permalink / raw)
  To: nicolas.dichtel; +Cc: netdev, ebiederm

From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Fri,  3 Apr 2015 12:02:37 +0200

> First, let's explain the problem.
> Suppose you have an ipip interface that stands in the netns foo and its link
> part in the netns bar (so the netns bar has an nsid into the netns foo).
> Now, you remove the netns bar:
>  - the bar nsid into the netns foo is removed
>  - the netns exit method of ipip is called, thus our ipip iface is removed:
>    => a netlink message is built in the netns foo to advertise this deletion
>    => this netlink message requests an nsid for bar, thus a new nsid is
>       allocated for bar and never removed.
> 
> This patch adds a check in peernet2id() so that an id cannot be allocated for
> a netns which is currently destroyed.
> 
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>

Applied.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net 2/2] netns: don't allocate an id for dead netns
  2015-04-03 16:36           ` David Miller
@ 2015-04-05  8:39             ` Nicolas Dichtel
  2015-04-05 20:34               ` David Miller
  0 siblings, 1 reply; 21+ messages in thread
From: Nicolas Dichtel @ 2015-04-05  8:39 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, ebiederm

Le 03/04/2015 18:36, David Miller a écrit :
> From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> Date: Fri,  3 Apr 2015 12:02:37 +0200
>
>> First, let's explain the problem.
>> Suppose you have an ipip interface that stands in the netns foo and its link
>> part in the netns bar (so the netns bar has an nsid into the netns foo).
>> Now, you remove the netns bar:
>>   - the bar nsid into the netns foo is removed
>>   - the netns exit method of ipip is called, thus our ipip iface is removed:
>>     => a netlink message is built in the netns foo to advertise this deletion
>>     => this netlink message requests an nsid for bar, thus a new nsid is
>>        allocated for bar and never removed.
>>
>> This patch adds a check in peernet2id() so that an id cannot be allocated for
>> a netns which is currently destroyed.
>>
>> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
>
> Applied.
>
I don't see these patches in your tree, maybe you forget to push them on
kernel.org?
My other series will conflict with these patches, is it possible to merge
net into net-next after them?

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net 2/2] netns: don't allocate an id for dead netns
  2015-04-05  8:39             ` Nicolas Dichtel
@ 2015-04-05 20:34               ` David Miller
  2015-04-07  9:36                 ` Nicolas Dichtel
  0 siblings, 1 reply; 21+ messages in thread
From: David Miller @ 2015-04-05 20:34 UTC (permalink / raw)
  To: nicolas.dichtel; +Cc: netdev, ebiederm

From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Sun, 05 Apr 2015 10:39:53 +0200

> I don't see these patches in your tree, maybe you forget to push
> them on kernel.org?

Indeed, I did, pushed out now.  Sorry about that.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net 2/2] netns: don't allocate an id for dead netns
  2015-04-05 20:34               ` David Miller
@ 2015-04-07  9:36                 ` Nicolas Dichtel
  0 siblings, 0 replies; 21+ messages in thread
From: Nicolas Dichtel @ 2015-04-07  9:36 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, ebiederm

Le 05/04/2015 22:34, David Miller a écrit :
> From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> Date: Sun, 05 Apr 2015 10:39:53 +0200
>
>> I don't see these patches in your tree, maybe you forget to push
>> them on kernel.org?
>
> Indeed, I did, pushed out now.  Sorry about that.
>
No problem, thank you.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH net-next v2 0/3] netns: enhance netlink interface for nsid
  2015-04-01 12:49 [PATCH net-next 0/4] netns: enhance netlink interface for nsid Nicolas Dichtel
                   ` (4 preceding siblings ...)
  2015-04-01 16:54 ` [PATCH net-next 0/4] netns: enhance netlink interface for nsid Cong Wang
@ 2015-04-07  9:51 ` Nicolas Dichtel
  2015-04-07  9:51   ` [PATCH net-next v2 1/3] netns: minor cleanup in rtnl_net_getid() Nicolas Dichtel
                     ` (3 more replies)
  5 siblings, 4 replies; 21+ messages in thread
From: Nicolas Dichtel @ 2015-04-07  9:51 UTC (permalink / raw)
  To: netdev; +Cc: davem, ebiederm


The first patch is a small cleanup. The second patch implements notifications
for netns id events. And the last one allows to dump existing netns id from
userland.

iproute2 patches are available, I can send them on demand.

v2: drop the first patch (the fix is now in net-next)

 include/uapi/linux/rtnetlink.h |   4 ++
 net/core/net_namespace.c       | 103 +++++++++++++++++++++++++++++++++++++----
 2 files changed, 97 insertions(+), 10 deletions(-)

Comments are welcome.

Regards,
Nicolas

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH net-next v2 1/3] netns: minor cleanup in rtnl_net_getid()
  2015-04-07  9:51 ` [PATCH net-next v2 0/3] " Nicolas Dichtel
@ 2015-04-07  9:51   ` Nicolas Dichtel
  2015-04-07  9:51   ` [PATCH net-next v2 2/3] netns: notify netns id events Nicolas Dichtel
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 21+ messages in thread
From: Nicolas Dichtel @ 2015-04-07  9:51 UTC (permalink / raw)
  To: netdev; +Cc: davem, ebiederm, Nicolas Dichtel

No need to initialize err, it will be overridden by the value of nlmsg_parse().

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 net/core/net_namespace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index e7345d9031df..be28afccfbbb 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -565,8 +565,8 @@ static int rtnl_net_getid(struct sk_buff *skb, struct nlmsghdr *nlh)
 	struct net *net = sock_net(skb->sk);
 	struct nlattr *tb[NETNSA_MAX + 1];
 	struct sk_buff *msg;
-	int err = -ENOBUFS;
 	struct net *peer;
+	int err;
 
 	err = nlmsg_parse(nlh, sizeof(struct rtgenmsg), tb, NETNSA_MAX,
 			  rtnl_net_policy);
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next v2 2/3] netns: notify netns id events
  2015-04-07  9:51 ` [PATCH net-next v2 0/3] " Nicolas Dichtel
  2015-04-07  9:51   ` [PATCH net-next v2 1/3] netns: minor cleanup in rtnl_net_getid() Nicolas Dichtel
@ 2015-04-07  9:51   ` Nicolas Dichtel
  2015-04-07  9:51   ` [PATCH net-next v2 3/3] netns: allow to dump netns ids Nicolas Dichtel
  2015-04-07 21:30   ` [PATCH net-next v2 0/3] netns: enhance netlink interface for nsid David Miller
  3 siblings, 0 replies; 21+ messages in thread
From: Nicolas Dichtel @ 2015-04-07  9:51 UTC (permalink / raw)
  To: netdev; +Cc: davem, ebiederm, Nicolas Dichtel

With this patch, netns ids that are created and deleted are advertised into the
group RTNLGRP_NSID.

Because callers of rtnl_net_notifyid() already know the id of the peer, there is
no need to call __peernet2id() in rtnl_net_fill().

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 include/uapi/linux/rtnetlink.h |  4 ++++
 net/core/net_namespace.c       | 52 +++++++++++++++++++++++++++++++++++-------
 2 files changed, 48 insertions(+), 8 deletions(-)

diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h
index bea910f924dd..974db03f7b1a 100644
--- a/include/uapi/linux/rtnetlink.h
+++ b/include/uapi/linux/rtnetlink.h
@@ -134,6 +134,8 @@ enum {
 
 	RTM_NEWNSID = 88,
 #define RTM_NEWNSID RTM_NEWNSID
+	RTM_DELNSID = 89,
+#define RTM_DELNSID RTM_DELNSID
 	RTM_GETNSID = 90,
 #define RTM_GETNSID RTM_GETNSID
 
@@ -635,6 +637,8 @@ enum rtnetlink_groups {
 #define RTNLGRP_MDB		RTNLGRP_MDB
 	RTNLGRP_MPLS_ROUTE,
 #define RTNLGRP_MPLS_ROUTE	RTNLGRP_MPLS_ROUTE
+	RTNLGRP_NSID,
+#define RTNLGRP_NSID		RTNLGRP_NSID
 	__RTNLGRP_MAX
 };
 #define RTNLGRP_MAX	(__RTNLGRP_MAX - 1)
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index be28afccfbbb..b3b5f22f0e90 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -148,9 +148,11 @@ static void ops_free_list(const struct pernet_operations *ops,
 	}
 }
 
+static void rtnl_net_notifyid(struct net *net, struct net *peer, int cmd,
+			      int id);
 static int alloc_netid(struct net *net, struct net *peer, int reqid)
 {
-	int min = 0, max = 0;
+	int min = 0, max = 0, id;
 
 	ASSERT_RTNL();
 
@@ -159,7 +161,11 @@ static int alloc_netid(struct net *net, struct net *peer, int reqid)
 		max = reqid + 1;
 	}
 
-	return idr_alloc(&net->netns_ids, peer, min, max, GFP_KERNEL);
+	id = idr_alloc(&net->netns_ids, peer, min, max, GFP_KERNEL);
+	if (id >= 0)
+		rtnl_net_notifyid(net, peer, RTM_NEWNSID, id);
+
+	return id;
 }
 
 /* This function is used by idr_for_each(). If net is equal to peer, the
@@ -359,8 +365,10 @@ static void cleanup_net(struct work_struct *work)
 		for_each_net(tmp) {
 			int id = __peernet2id(tmp, net, false);
 
-			if (id >= 0)
+			if (id >= 0) {
+				rtnl_net_notifyid(tmp, net, RTM_DELNSID, id);
 				idr_remove(&tmp->netns_ids, id);
+			}
 		}
 		idr_destroy(&net->netns_ids);
 
@@ -531,7 +539,8 @@ static int rtnl_net_get_size(void)
 }
 
 static int rtnl_net_fill(struct sk_buff *skb, u32 portid, u32 seq, int flags,
-			 int cmd, struct net *net, struct net *peer)
+			 int cmd, struct net *net, struct net *peer,
+			 int nsid)
 {
 	struct nlmsghdr *nlh;
 	struct rtgenmsg *rth;
@@ -546,9 +555,13 @@ static int rtnl_net_fill(struct sk_buff *skb, u32 portid, u32 seq, int flags,
 	rth = nlmsg_data(nlh);
 	rth->rtgen_family = AF_UNSPEC;
 
-	id = __peernet2id(net, peer, false);
-	if  (id < 0)
-		id = NETNSA_NSID_NOT_ASSIGNED;
+	if (nsid >= 0) {
+		id = nsid;
+	} else {
+		id = __peernet2id(net, peer, false);
+		if  (id < 0)
+			id = NETNSA_NSID_NOT_ASSIGNED;
+	}
 	if (nla_put_s32(skb, NETNSA_NSID, id))
 		goto nla_put_failure;
 
@@ -589,7 +602,7 @@ static int rtnl_net_getid(struct sk_buff *skb, struct nlmsghdr *nlh)
 	}
 
 	err = rtnl_net_fill(msg, NETLINK_CB(skb).portid, nlh->nlmsg_seq, 0,
-			    RTM_GETNSID, net, peer);
+			    RTM_GETNSID, net, peer, -1);
 	if (err < 0)
 		goto err_out;
 
@@ -603,6 +616,29 @@ out:
 	return err;
 }
 
+static void rtnl_net_notifyid(struct net *net, struct net *peer, int cmd,
+			      int id)
+{
+	struct sk_buff *msg;
+	int err = -ENOMEM;
+
+	msg = nlmsg_new(rtnl_net_get_size(), GFP_KERNEL);
+	if (!msg)
+		goto out;
+
+	err = rtnl_net_fill(msg, 0, 0, 0, cmd, net, peer, id);
+	if (err < 0)
+		goto err_out;
+
+	rtnl_notify(msg, net, 0, RTNLGRP_NSID, NULL, 0);
+	return;
+
+err_out:
+	nlmsg_free(msg);
+out:
+	rtnl_set_sk_err(net, RTNLGRP_NSID, err);
+}
+
 static int __init net_ns_init(void)
 {
 	struct net_generic *ng;
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next v2 3/3] netns: allow to dump netns ids
  2015-04-07  9:51 ` [PATCH net-next v2 0/3] " Nicolas Dichtel
  2015-04-07  9:51   ` [PATCH net-next v2 1/3] netns: minor cleanup in rtnl_net_getid() Nicolas Dichtel
  2015-04-07  9:51   ` [PATCH net-next v2 2/3] netns: notify netns id events Nicolas Dichtel
@ 2015-04-07  9:51   ` Nicolas Dichtel
  2015-04-07 21:30   ` [PATCH net-next v2 0/3] netns: enhance netlink interface for nsid David Miller
  3 siblings, 0 replies; 21+ messages in thread
From: Nicolas Dichtel @ 2015-04-07  9:51 UTC (permalink / raw)
  To: netdev; +Cc: davem, ebiederm, Nicolas Dichtel

Which this patch, it's possible to dump the list of ids allocated for peer
netns.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 net/core/net_namespace.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 48 insertions(+), 1 deletion(-)

diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index b3b5f22f0e90..a3abb719221f 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -616,6 +616,52 @@ out:
 	return err;
 }
 
+struct rtnl_net_dump_cb {
+	struct net *net;
+	struct sk_buff *skb;
+	struct netlink_callback *cb;
+	int idx;
+	int s_idx;
+};
+
+static int rtnl_net_dumpid_one(int id, void *peer, void *data)
+{
+	struct rtnl_net_dump_cb *net_cb = (struct rtnl_net_dump_cb *)data;
+	int ret;
+
+	if (net_cb->idx < net_cb->s_idx)
+		goto cont;
+
+	ret = rtnl_net_fill(net_cb->skb, NETLINK_CB(net_cb->cb->skb).portid,
+			    net_cb->cb->nlh->nlmsg_seq, NLM_F_MULTI,
+			    RTM_NEWNSID, net_cb->net, peer, id);
+	if (ret < 0)
+		return ret;
+
+cont:
+	net_cb->idx++;
+	return 0;
+}
+
+static int rtnl_net_dumpid(struct sk_buff *skb, struct netlink_callback *cb)
+{
+	struct net *net = sock_net(skb->sk);
+	struct rtnl_net_dump_cb net_cb = {
+		.net = net,
+		.skb = skb,
+		.cb = cb,
+		.idx = 0,
+		.s_idx = cb->args[0],
+	};
+
+	ASSERT_RTNL();
+
+	idr_for_each(&net->netns_ids, rtnl_net_dumpid_one, &net_cb);
+
+	cb->args[0] = net_cb.idx;
+	return skb->len;
+}
+
 static void rtnl_net_notifyid(struct net *net, struct net *peer, int cmd,
 			      int id)
 {
@@ -673,7 +719,8 @@ static int __init net_ns_init(void)
 	register_pernet_subsys(&net_ns_ops);
 
 	rtnl_register(PF_UNSPEC, RTM_NEWNSID, rtnl_net_newid, NULL, NULL);
-	rtnl_register(PF_UNSPEC, RTM_GETNSID, rtnl_net_getid, NULL, NULL);
+	rtnl_register(PF_UNSPEC, RTM_GETNSID, rtnl_net_getid, rtnl_net_dumpid,
+		      NULL);
 
 	return 0;
 }
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next v2 0/3] netns: enhance netlink interface for nsid
  2015-04-07  9:51 ` [PATCH net-next v2 0/3] " Nicolas Dichtel
                     ` (2 preceding siblings ...)
  2015-04-07  9:51   ` [PATCH net-next v2 3/3] netns: allow to dump netns ids Nicolas Dichtel
@ 2015-04-07 21:30   ` David Miller
  3 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2015-04-07 21:30 UTC (permalink / raw)
  To: nicolas.dichtel; +Cc: netdev, ebiederm

From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Tue,  7 Apr 2015 11:51:51 +0200

> The first patch is a small cleanup. The second patch implements notifications
> for netns id events. And the last one allows to dump existing netns id from
> userland.
> 
> iproute2 patches are available, I can send them on demand.
> 
> v2: drop the first patch (the fix is now in net-next)

Series applied, thanks.

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2015-04-07 21:30 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-01 12:49 [PATCH net-next 0/4] netns: enhance netlink interface for nsid Nicolas Dichtel
2015-04-01 12:49 ` [PATCH net-next 1/4] netns: don't clear nsid too early on removal Nicolas Dichtel
2015-04-02 18:51   ` Eric W. Biederman
2015-04-03  9:56     ` Nicolas Dichtel
2015-04-03 10:02       ` [PATCH net 1/2] Revert "netns: don't clear nsid too early on removal" Nicolas Dichtel
2015-04-03 10:02         ` [PATCH net 2/2] netns: don't allocate an id for dead netns Nicolas Dichtel
2015-04-03 16:36           ` David Miller
2015-04-05  8:39             ` Nicolas Dichtel
2015-04-05 20:34               ` David Miller
2015-04-07  9:36                 ` Nicolas Dichtel
2015-04-03 16:36         ` [PATCH net 1/2] Revert "netns: don't clear nsid too early on removal" David Miller
2015-04-01 12:49 ` [PATCH net-next 2/4] netns: minor cleanup in rtnl_net_getid() Nicolas Dichtel
2015-04-01 12:49 ` [PATCH net-next 3/4] netns: notify netns id events Nicolas Dichtel
2015-04-01 12:49 ` [PATCH net-next 4/4] netns: allow to dump netns ids Nicolas Dichtel
2015-04-01 16:54 ` [PATCH net-next 0/4] netns: enhance netlink interface for nsid Cong Wang
2015-04-02  8:52   ` Nicolas Dichtel
2015-04-07  9:51 ` [PATCH net-next v2 0/3] " Nicolas Dichtel
2015-04-07  9:51   ` [PATCH net-next v2 1/3] netns: minor cleanup in rtnl_net_getid() Nicolas Dichtel
2015-04-07  9:51   ` [PATCH net-next v2 2/3] netns: notify netns id events Nicolas Dichtel
2015-04-07  9:51   ` [PATCH net-next v2 3/3] netns: allow to dump netns ids Nicolas Dichtel
2015-04-07 21:30   ` [PATCH net-next v2 0/3] netns: enhance netlink interface for nsid David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.