On Fri, May 08, 2015 at 12:36:56PM -0500, Eric W. Biederman wrote: > > At the same time while a network namespace remains discoverable we might > be using it in small ways. So I am wondering if this is the right > approach. > > It really is invalid for a network namespace init routine to grab the > reference count of it's network namespace (thus making the network > namespace unfreeable). So I am wondering if perhaps all we need to do > is find a clean refactoring of the socket code so this case does not > come up at all. > > Perhaps just a flag that says this is a kernel socket so don't get/put > the refcount on the network namespace.
No this line of thinking is what led us into the hole in the first place. Really it's perfectly valid for the init function to want to take a reference on net. For all we know it might be a temporary reference taken by a third party. It doesn't even have to be a socket. We must hide this subtlety from ops implementors since they have no knowledge of our implementation. Expecting them to deal with this is going to result in bugs, and we have already had multiple bugs in this area. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html