All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Emelyanov <xemul-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
To: Serge Hallyn <serge.hallyn-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Cc: Linux Containers
	<containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
	"Eric W. Biederman"
	<ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Subject: Re: setns vs unshare bug
Date: Fri, 10 Aug 2012 19:17:16 +0400	[thread overview]
Message-ID: <502525FC.3060608@parallels.com> (raw)
In-Reply-To: <502523DF.4040103-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>

On 08/10/2012 07:08 PM, Pavel Emelyanov wrote:
> On 08/10/2012 07:00 PM, Serge Hallyn wrote:
>> Hi Pavel,
>>
>> I don't believe this is a bug.  The fd is to a specific network
>> namespace.  If the target task later changes his namespace, that
>> doesn't change the fact that you asked for access to the old
>> namespace.
>>
>> You're worried about a race?
> 
> No, it's not a race. The proc ns file doesn't reflect the actual state
> of a task it belongs to, but instead has some internal state which is
> not observable/controllable from the outside. Look at my proggie -- the
> "else" branch does expects that setns will bring it into a new net, but
> it only does so if proc dcache is empty!

I mean -- I open a task's proc ns file _strictly_ _after_ that task called
unshare, but happen to obtain an _old_ net namespace, because this old netns
was cached on the task's proc file.

Hope this explains better what I'm concerned about.

Thanks,
Pavel

  parent reply	other threads:[~2012-08-10 15:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-10 14:55 setns vs unshare bug Pavel Emelyanov
     [not found] ` <502520E8.5040401-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2012-08-10 15:00   ` Serge Hallyn
2012-08-10 15:08     ` Pavel Emelyanov
     [not found]       ` <502523DF.4040103-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2012-08-10 15:17         ` Pavel Emelyanov [this message]
     [not found]           ` <502525FC.3060608-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2012-08-10 15:24             ` Serge Hallyn

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=502525FC.3060608@parallels.com \
    --to=xemul-bzqdu9zft3wakbo8gow8eq@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org \
    --cc=serge.hallyn-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org \
    /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.