[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <874mnm4iu1.fsf@x220.int.ebiederm.org>
Date: Fri, 08 May 2015 20:53:42 -0500
From: ebiederm@...ssion.com (Eric W. Biederman)
To: Herbert Xu <herbert@...dor.apana.org.au>
Cc: Ying Xue <ying.xue@...driver.com>, netdev@...r.kernel.org,
cwang@...pensource.com, xemul@...nvz.org, davem@...emloft.net,
eric.dumazet@...il.com, maxk@....qualcomm.com,
stephen@...workplumber.org, tgraf@...g.ch,
nicolas.dichtel@...nd.com, tom@...bertland.com,
jchapman@...alix.com, erik.hugne@...csson.com,
jon.maloy@...csson.com, horms@...ge.net.au
Subject: Re: [RFC PATCH net-next 00/11] netns: don't switch namespace while creating kernel sockets
Herbert Xu <herbert@...dor.apana.org.au> writes:
> 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.
I won't fundamentally argue. However the worst hack and subtlety come
from the way we deal with kernel sockets and that is much easier to
clean up so we might as well get that first.
Eric
--
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