mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Andy Lutomirski <luto@amacapital.net>
Cc: "linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Serge E. Hallyn" <serge@canonical.com>,
	Linux Containers <containers@lists.linux-foundation.org>
Subject: Re: pid ns feature request
Date: Fri, 25 Apr 2014 14:17:46 -0700	[thread overview]
Message-ID: <87oazpyupx.fsf@x220.int.ebiederm.org> (raw)
In-Reply-To: <CALCETrU_SE=7QH-rDOqOsB5T4v+VEGL_3ZYRPgt6QWHB5BEGdg@mail.gmail.com> (Andy Lutomirski's message of "Fri, 25 Apr 2014 13:46:23 -0700")

Andy Lutomirski <luto@amacapital.net> writes:

> On Fri, Apr 25, 2014 at 1:25 PM, Eric W. Biederman
> <ebiederm@xmission.com> wrote:
>> Andy Lutomirski <luto@amacapital.net> writes:
>>
>>> On Fri, Apr 25, 2014 at 12:37 PM, Eric W. Biederman
>>> <ebiederm@xmission.com> wrote:
>>>> Andy Lutomirski <luto@amacapital.net> writes:
>>>>
>>>>> Unless I'm missing some trick, it's currently rather painful to mount
>>>>> a namespace /proc.  You have to actually be in the pid namespace to
>>>>> mount the correct /proc instance, and you can't unmount the old /proc
>>>>> until you've mounted the new /proc.  This means that you have to fork
>>>>> into the new pid namespace before you can finish setting it up.
>>>>
>>>> Yes.  You have to be inside just about all namespaces before you can
>>>> finish setting them up.
>>>>
>>>> I don't know the context in which needed to be inside the pid namespace
>>>> is a burden.
>>>
>>> I'm trying to sandbox myself.  I unshare everything, setup up new
>>> mounts, pivot_root, umount the old stuff, fork, and wait around for
>>> the child to finish.
>>>
>>> This doesn't work: the parent can't mount the new /proc, and the child
>>> can't either because it's too late.
>>>
>>> The only solution I can think of without kernel changes is to fork the
>>> child (pid 1) before pivot_root, which makes everything more
>>> complicated.  I suppose I can unshare, fork immediately, have the
>>> child set up all the mounts, and then wake the parent, but this is an
>>> annoying bit of extra complexity for no obvious gain.
>>
>> Or perhaps just use clone and clone flags.
>>
>> What are you doing with the parent process?  What value does it serve?
>
> I'm not entirely sure.  I'm hacking on this thing:
>
> https://github.com/amluto/sandstorm/tree/userns
>
> which isn't really my code.  But there's an inner sandbox and an outer
> sandbox, and only the inner sandbox is in a pid namespace.
>
> I suppose what what I'm doing is a bit strange.

A bit.   But doing strange things is good.

Right now most of my energy is focused on closely the last of the design
issues.  So I don't have much energy for new namespace related features
right now.

Eric

  parent reply	other threads:[~2014-04-25 21:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-25 15:58 Andy Lutomirski
2014-04-25 19:37 ` Eric W. Biederman
2014-04-25 19:50   ` Andy Lutomirski
2014-04-25 20:25     ` Eric W. Biederman
2014-04-25 20:46       ` Andy Lutomirski
2014-04-25 20:55         ` Andy Lutomirski
2014-04-25 21:17         ` Eric W. Biederman [this message]
2014-04-25 21:23           ` Andy Lutomirski
2014-04-28 13:39     ` Serge Hallyn
2014-04-29 16:32       ` Andy Lutomirski

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=87oazpyupx.fsf@x220.int.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=containers@lists.linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=serge@canonical.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome