All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Landley <rlandley@parallels.com>
To: "Serge E. Hallyn" <serge@hallyn.com>
Cc: <linux-kernel@vger.kernel.org>, <linux-nfs@vger.kernel.org>,
	<containers@lists.linux-foundation.org>,
	Trond Myklebust <Trond.Myklebust@netapp.com>,
	Tim Spriggs <tims@uahirise.org>,
	Kir Kolyshkin <kir@parallels.com>,
	Pavel Emelyanov <xemul@parallels.com>
Subject: Re: [PATCH 3/3] Compare namespaces when comparing addresses in auth_unix cache.
Date: Fri, 8 Apr 2011 10:08:34 -0500	[thread overview]
Message-ID: <4D9F24F2.9020603@parallels.com> (raw)
In-Reply-To: <20110405034641.GC6764@hallyn.com>

On 04/04/2011 10:46 PM, Serge E. Hallyn wrote:
> Quoting Rob Landley (rlandley@parallels.com):
>> From: Rob Landley <rlandley@parallels.com>
>>
>> The auth_unix cache needs to check network namespace when comparing
>> addresses. Add field to struct ip_map and extra argument to
>> __ip_map_lookup() so it has the information to do so, and add test.
>>
>> Signed-off-by: Rob Landley <rlandley@parallels.com>
>> ---
>>
>>  net/sunrpc/svcauth_unix.c |   21 ++++++++++++++-------
>>  1 file changed, 14 insertions(+), 7 deletions(-)
>>
>> diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c
>> index 30916b0..63a2fa7 100644
>> --- a/net/sunrpc/svcauth_unix.c
>> +++ b/net/sunrpc/svcauth_unix.c

code code code

>> @@ -142,6 +145,7 @@ static void ip_map_init(struct cache_head *cnew, struct cache_head *citem)
>>  	struct ip_map *item = container_of(citem, struct ip_map, h);
>>  
>>  	strcpy(new->m_class, item->m_class);
>> +	new->m_net = item->m_net;
> 
> Does this need to take a reference?  Or is there no way for an
> entry to outlive its netns?  It sort of looks like
> svcauth_unix_info_release will ensure that doesn't happen, but
> I'm not convinced because other parts of the kernel can get
> to ip_map_init through the struct cache_detail.

When I wrote this I thought the transport's get_net() and put_net()
would pin it, but after re-reading, the sunrpc code is disgustingly
convoluted enough that I can't easily reconstruct my earlier reasoning.
 I'll add a get_net() and put_net() just to not have to worry about it.

Thanks,

Rob

  parent reply	other threads:[~2011-04-08 15:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-31  7:48 [PATCH 3/3] Compare namespaces when comparing addresses in auth_unix cache Rob Landley
     [not found] ` <4D9431B3.2070305-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2011-04-05  3:46   ` Serge E. Hallyn
2011-04-05  3:46 ` Serge E. Hallyn
     [not found]   ` <20110405034641.GC6764-A9i7LUbDfNHQT0dZR+AlfA@public.gmane.org>
2011-04-08 15:08     ` Rob Landley
2011-04-08 15:08   ` Rob Landley [this message]
     [not found]     ` <4D9F24F2.9020603-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2011-04-11 13:29       ` Rob Landley
2011-04-11 13:29     ` Rob Landley
     [not found]       ` <4DA30222.5040902-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2011-04-11 13:36         ` Serge E. Hallyn
2011-04-11 13:36       ` Serge E. Hallyn
2011-04-11 13:57         ` Alexey Dobriyan
     [not found]           ` <BANLkTi=sh1CB+e1EhU-c-Bs3BCszWEBTMA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-04-11 17:45             ` Rob Landley
2011-04-11 17:45           ` Rob Landley
     [not found]         ` <20110411133602.GA5321-A9i7LUbDfNHQT0dZR+AlfA@public.gmane.org>
2011-04-11 13:57           ` Alexey Dobriyan
2011-03-31  7:48 Rob Landley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D9F24F2.9020603@parallels.com \
    --to=rlandley@parallels.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=containers@lists.linux-foundation.org \
    --cc=kir@parallels.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=serge@hallyn.com \
    --cc=tims@uahirise.org \
    --cc=xemul@parallels.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.