Subject: Re: [PATCH net-next 1/4] netns: don't clear nsid too early on removal

From: Nicolas Dichtel <[email-masked]>
Date: Fri, 03 Apr 2015 11:56:09 +0200

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.