public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Chris Webb <chris@arachsys.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Building a BSD-jail clone out of namespaces
Date: Thu, 06 Jun 2013 09:56:10 -0700	[thread overview]
Message-ID: <871u8f89g5.fsf@xmission.com> (raw)
In-Reply-To: <20130606164651.GA24681@arachsys.com> (Chris Webb's message of "Thu, 6 Jun 2013 17:46:52 +0100")

Chris Webb <chris@arachsys.com> writes:

> "Eric W. Biederman" <ebiederm@xmission.com> writes:
>
>> That will work, but you really don't want to run with uid == 0 mapped to
>> uid == 0.  There are too many things in /proc and /sys and similar that
>> grant access to uid == 0.
>
> Many thanks for the swift reply. If I map UID zero in the userns to a
> non-zero UID outside (say -1), is there any way to use the userns UIDs
> instead of host UIDs when accessing the container's root filesystem so I
> don't end up with strange file ownerships on disk? This would prevent me
> from using the same filesystem on physical hosts or in VMs.

Hmm.  I guess it depends on how your VM is reading them.  If it is
blocked based access to the filesystem you have a problem.   If the VM
is effectively NFS mounting the filesystem you can do all kinds of
things.

It is possible to just change the user namespace and setup your mapping,
effectively running your VM in the user namespace, and that would allow
the VM to see your mapped uids.

> I don't think there's any kernel mechanism that lets me apply a UID
> translation layer as part of a bind mount is there?

No.  In principle you could mount the filesystem inside of the user
namespace but in practice no filesystems support that yet.

Eric

  reply	other threads:[~2013-06-06 16:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-06 16:10 Building a BSD-jail clone out of namespaces Chris Webb
2013-06-06 16:35 ` Eric W. Biederman
2013-06-06 16:46   ` Chris Webb
2013-06-06 16:56     ` Eric W. Biederman [this message]
2013-06-06 21:51   ` Chris Webb
2013-06-07  4:06     ` Eric W. Biederman
2013-06-07 12:58       ` Chris Webb
2013-06-27 13:43 ` Chris Webb

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=871u8f89g5.fsf@xmission.com \
    --to=ebiederm@xmission.com \
    --cc=chris@arachsys.com \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox