From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Jan Kara <jack@suse.cz>, Seth Forshee <seth.forshee@canonical.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
Linux Containers <containers@lists.linux-foundation.org>,
linux-fsdevel@vger.kernel.org,
Linux API <linux-api@vger.kernel.org>,
Djalal Harouni <tixxdz@gmail.com>,
"Serge E. Hallyn" <serge@hallyn.com>,
Andy Lutomirski <luto@amacapital.net>,
Jann Horn <jannh@google.com>,
Michael Kerrisk <mtk.manpages@gmail.com>
Subject: Re: [PATCH review 0/11] General unprivileged mount support
Date: Wed, 06 Jul 2016 08:23:50 -0700 [thread overview]
Message-ID: <1467818630.2369.21.camel@HansenPartnership.com> (raw)
In-Reply-To: <20160706142255.GB21164@quack2.suse.cz>
On Wed, 2016-07-06 at 16:22 +0200, Jan Kara wrote:
> On Wed 06-07-16 08:54:46, Seth Forshee wrote:
> > On Wed, Jul 06, 2016 at 10:54:40AM +0200, Jan Kara wrote:
> > > On Mon 04-07-16 11:27:46, Eric W. Biederman wrote:
> > > I don't remember the indented uses for user-ns mounts so I may be
> > > just wrong. But my experience tells me that external data (such
> > > as user namespace ID mappings in your case) that modify meaning
> > > of on-disk format tend to cause maintenance difficulties in the
> > > long run... Because someone *will* have the idea of migrating
> > > these fs images between containers / machines and then they have
> > > to make sure mappings get migrated as well and it all becomes
> > > cumbersome.
> >
> > The intended use case for this is containers, with the idea being
> > that I as a user will get the same behavior in the container as I
> > would in init_user_ns without needing any userspace modifications
> > to achieve that.
> >
> > So if I have a filesystem that contains uid 0 and I mount it in my
> > container, I should see uid 0. If I mount the same bits in another
> > container with a different uid mapping I should also see uid 0.
> >
> > If I mkfs a new filesystem in my container then mount it, the root
> > directory of the fs is owned by uid 0 in my container without any
> > modifications to mkfs.
> >
> > I'd argue that this makes it easier to migrate a disk between
> > containers because the ids in the disk show up the same within the
> > container regardless of the id mapping. If someone wants to mount a
> > filesystem in one container and also access it in another container
> > with a completely different id mapping, well I don't think that's
> > ever going to work well.
>
> OK, I see how this is supposed to work. However you assume here that
> both containers have the same set of valid UIDs, don't you? If that
> is not the case, the mounted image will not be usable in the other
> container, right?
You can always set it up wrongly is the rule of containers. Because
the virtualizations are so granular, there are many possible
configurations which don't make sense in the real world.
The main use case for this is operating system images. For them we
have a set of known UID/GIDs in the image (usually 0-1000 plus the
nobody/nogroups for both). Using this scheme, we'd set up the
container in a userns that mapped all these ids to something
unprivileged and then set up a s_user_ns to do the same for the mount
location of the image meaning that the unprivileged container can now
manipulate the image.
There are several self contained proposals on linux-fsdevel for doing
this, like shifts, which is what I'm currently using to manipulate
images, so for me what it does is allows me to get rid of all the
credential shifting when performing operations on the underlying
filesystem. In fact, I think it pretty much allows me to get rid of a
lot of the upper/lower filesystem distinction in shiftfs and I'd get
quotas and other stuff I ignored for free.
However, any of the other uid/gid shifting proposals can also use this
as the engine.
The point here is, this patch set is simply mechanism; it requires a
glue layer (like shiftfs, fuse or the vfs remapping proposal) to
activate it. The activation decides how much exposure to the
underlying filesystem there is, so with shiftfs, there's none, it's a
purely volatile system crafted for chosen images. However, it's fully
possible to come up with an activation where the filesystem would
decide (through some on disk format information) to declare the image
to be safely remapped in this uid/gid range and then we could allow it
to be mounted unprivileged (without a capability check) into a user_ns
that matched the mapping. This latter is a bit of a fantasy since
container images are currently little more than tar files and we have
no extant way to connect them to linux fs formats, but once the
possibility exists, whose to say this won't change?
James
next prev parent reply other threads:[~2016-07-06 15:23 UTC|newest]
Thread overview: 135+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-02 17:18 [PATCH review 0/11] General unprivileged mount support Eric W. Biederman
2016-07-02 17:18 ` Eric W. Biederman
2016-07-02 17:20 ` [PATCH review 01/11] fs: Refuse uid/gid changes which don't map into s_user_ns Eric W. Biederman
2016-07-02 17:20 ` [PATCH review 03/11] vfs: Verify acls are valid within superblock's s_user_ns Eric W. Biederman
2016-07-02 17:20 ` [PATCH review 05/11] cred: Reject inodes with invalid ids in set_create_file_as() Eric W. Biederman
2016-07-02 17:20 ` [PATCH review 07/11] vfs: Don't create inodes with a uid or gid unknown to the vfs Eric W. Biederman
[not found] ` <20160702172035.19568-7-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2016-07-04 7:59 ` Jan Kara
2016-07-04 7:59 ` Jan Kara
[not found] ` <20160704075919.GA5200-4I4JzKEfoa/jFM9bn6wA6Q@public.gmane.org>
2016-07-05 14:55 ` Eric W. Biederman
2016-07-05 14:55 ` Eric W. Biederman
[not found] ` <87zipwxhgp.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
2016-07-06 9:07 ` Jan Kara
2016-07-06 9:07 ` Jan Kara
[not found] ` <20160706090705.GE14067-4I4JzKEfoa/jFM9bn6wA6Q@public.gmane.org>
2016-07-06 15:37 ` Eric W. Biederman
2016-07-06 15:37 ` Eric W. Biederman
2016-07-06 15:37 ` Eric W. Biederman
2016-07-04 7:59 ` Jan Kara
2016-07-02 17:20 ` [PATCH review 08/11] quota: Ensure qids map to the filesystem Eric W. Biederman
2016-07-02 17:20 ` [PATCH review 10/11] evm: Translate user/group ids relative to s_user_ns when computing HMAC Eric W. Biederman
[not found] ` <20160702172035.19568-1-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2016-07-02 17:20 ` [PATCH review 02/11] userns: Handle -1 in k[ug]id_has_mapping when !CONFIG_USER_NS Eric W. Biederman
2016-07-02 17:20 ` Eric W. Biederman
2016-07-02 17:20 ` [PATCH review 03/11] vfs: Verify acls are valid within superblock's s_user_ns Eric W. Biederman
2016-07-02 17:20 ` [PATCH review 04/11] fs: Check for invalid i_uid in may_follow_link() Eric W. Biederman
2016-07-02 17:20 ` Eric W. Biederman
2016-07-02 17:20 ` Eric W. Biederman
2016-07-02 17:20 ` [PATCH review 05/11] cred: Reject inodes with invalid ids in set_create_file_as() Eric W. Biederman
2016-07-02 17:20 ` [PATCH review 06/11] vfs: Don't modify inodes with a uid or gid unknown to the vfs Eric W. Biederman
2016-07-02 17:20 ` Eric W. Biederman
2016-07-02 17:20 ` Eric W. Biederman
2016-07-02 17:20 ` [PATCH review 07/11] vfs: Don't create " Eric W. Biederman
2016-07-02 17:20 ` [PATCH review 08/11] quota: Ensure qids map to the filesystem Eric W. Biederman
2016-07-02 17:20 ` [PATCH review 09/11] quota: Handle quota data stored in s_user_ns Eric W. Biederman
2016-07-02 17:20 ` Eric W. Biederman
[not found] ` <20160702172035.19568-9-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2016-07-02 17:33 ` [PATCH v2 " Eric W. Biederman
2016-07-02 17:33 ` Eric W. Biederman
[not found] ` <87mvm03pxy.fsf_-_-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
2016-07-04 9:11 ` Jan Kara
2016-07-04 9:11 ` Jan Kara
2016-07-04 9:11 ` Jan Kara
2016-07-05 14:48 ` Seth Forshee
2016-07-05 15:34 ` Eric W. Biederman
[not found] ` <87d1msumhy.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
2016-07-05 20:57 ` Dave Chinner
2016-07-05 20:57 ` Dave Chinner
2016-07-05 20:57 ` Dave Chinner
2016-07-05 21:28 ` Eric W. Biederman
2016-07-05 21:28 ` Eric W. Biederman
[not found] ` <8737nnrcyy.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
2016-07-06 6:35 ` Dave Chinner
2016-07-06 6:35 ` Dave Chinner
2016-07-06 8:25 ` Jan Kara
2016-07-06 8:25 ` Jan Kara
2016-07-06 17:51 ` Eric W. Biederman
[not found] ` <20160706082545.GC14067-4I4JzKEfoa/jFM9bn6wA6Q@public.gmane.org>
2016-07-06 17:51 ` Eric W. Biederman
2016-07-05 21:28 ` Eric W. Biederman
[not found] ` <20160704091100.GD5200-4I4JzKEfoa/jFM9bn6wA6Q@public.gmane.org>
2016-07-05 14:48 ` Seth Forshee
2016-07-05 15:34 ` Eric W. Biederman
2016-07-02 17:33 ` Eric W. Biederman
2016-07-02 17:20 ` [PATCH " Eric W. Biederman
2016-07-02 17:20 ` [PATCH review 10/11] evm: Translate user/group ids relative to s_user_ns when computing HMAC Eric W. Biederman
2016-07-02 17:20 ` [PATCH review 11/11] fs: Update i_[ug]id_(read|write) to translate relative to s_user_ns Eric W. Biederman
2016-07-02 17:20 ` Eric W. Biederman
2016-07-04 8:52 ` [PATCH review 0/11] General unprivileged mount support Jan Kara
[not found] ` <20160704085220.GC5200-4I4JzKEfoa/jFM9bn6wA6Q@public.gmane.org>
2016-07-04 16:27 ` Eric W. Biederman
2016-07-04 16:27 ` Eric W. Biederman
[not found] ` <87h9c52wsd.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
2016-07-06 8:54 ` Jan Kara
2016-07-06 8:54 ` Jan Kara
2016-07-06 13:54 ` Seth Forshee
2016-07-06 14:22 ` Jan Kara
2016-07-06 14:22 ` Jan Kara
2016-07-06 14:46 ` Seth Forshee
2016-07-06 15:01 ` Eric W. Biederman
[not found] ` <20160706142255.GB21164-4I4JzKEfoa/jFM9bn6wA6Q@public.gmane.org>
2016-07-06 14:46 ` Seth Forshee
2016-07-06 15:01 ` Eric W. Biederman
2016-07-06 15:23 ` James Bottomley
2016-07-06 15:23 ` James Bottomley [this message]
[not found] ` <1467818630.2369.21.camel-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk@public.gmane.org>
2016-07-06 16:35 ` Eric W. Biederman
2016-07-06 16:35 ` Eric W. Biederman
2016-07-06 14:22 ` Jan Kara
[not found] ` <20160706085440.GD14067-4I4JzKEfoa/jFM9bn6wA6Q@public.gmane.org>
2016-07-06 13:54 ` Seth Forshee
2016-07-04 16:27 ` Eric W. Biederman
[not found] ` <87ziq03qnj.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
2016-07-02 17:20 ` [PATCH review 01/11] fs: Refuse uid/gid changes which don't map into s_user_ns Eric W. Biederman
2016-07-04 8:52 ` [PATCH review 0/11] General unprivileged mount support Jan Kara
2016-07-06 13:44 ` Andy Lutomirski
2016-07-06 13:44 ` Andy Lutomirski
2016-07-06 13:44 ` Andy Lutomirski
[not found] ` <CALCETrVof174gPCZnD2Z-RMjR-P=NcA0mYCU9ki6=o9hpFL-BA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-07-06 15:21 ` Eric W. Biederman
2016-07-06 15:21 ` Eric W. Biederman
2016-07-06 14:01 ` Andy Lutomirski
2016-07-06 14:01 ` Andy Lutomirski
2016-07-06 15:19 ` Eric W. Biederman
2016-07-06 15:19 ` Eric W. Biederman
2016-07-06 14:01 ` Andy Lutomirski
2016-07-06 18:10 ` [PATCH review 0/12] General unprivileged mount support v2 Eric W. Biederman
2016-07-06 18:10 ` Eric W. Biederman
[not found] ` <874m82bptc.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
2016-07-06 18:12 ` [PATCH review 01/12] fs: Refuse uid/gid changes which don't map into s_user_ns Eric W. Biederman
2016-07-06 18:12 ` Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 02/12] userns: Handle -1 in k[ug]id_has_mapping when !CONFIG_USER_NS Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 03/12] vfs: Verify acls are valid within superblock's s_user_ns Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 04/12] fs: Check for invalid i_uid in may_follow_link() Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 05/12] cred: Reject inodes with invalid ids in set_create_file_as() Eric W. Biederman
[not found] ` <20160706181212.16267-1-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2016-07-06 18:12 ` [PATCH review 02/12] userns: Handle -1 in k[ug]id_has_mapping when !CONFIG_USER_NS Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 03/12] vfs: Verify acls are valid within superblock's s_user_ns Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 04/12] fs: Check for invalid i_uid in may_follow_link() Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 05/12] cred: Reject inodes with invalid ids in set_create_file_as() Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 06/12] vfs: Don't modify inodes with a uid or gid unknown to the vfs Eric W. Biederman
2016-07-06 18:12 ` Eric W. Biederman
2016-07-06 18:12 ` Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 07/12] vfs: Don't create " Eric W. Biederman
2016-07-06 18:12 ` Eric W. Biederman
2016-07-06 18:12 ` Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 08/12] quota: Ensure qids map to the filesystem Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 09/12] quota: Handle quota data stored in s_user_ns in quota_setxquota Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 10/12] dquot: For now explicitly don't support filesystems outside of init_user_ns Eric W. Biederman
2016-07-06 18:12 ` Eric W. Biederman
2016-07-11 10:09 ` Jan Kara
[not found] ` <20160706181212.16267-10-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2016-07-11 10:09 ` Jan Kara
2016-07-06 18:12 ` Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 11/12] evm: Translate user/group ids relative to s_user_ns when computing HMAC Eric W. Biederman
2016-07-06 18:12 ` Eric W. Biederman
2016-07-06 18:12 ` Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 12/12] fs: Update i_[ug]id_(read|write) to translate relative to s_user_ns Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 08/12] quota: Ensure qids map to the filesystem Eric W. Biederman
[not found] ` <20160706181212.16267-8-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2016-07-11 10:14 ` Jan Kara
2016-07-11 10:14 ` Jan Kara
[not found] ` <20160711101424.GH12410-4I4JzKEfoa/jFM9bn6wA6Q@public.gmane.org>
2016-07-11 18:12 ` Eric W. Biederman
2016-07-11 18:12 ` Eric W. Biederman
[not found] ` <878tx8dowu.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
2016-07-13 1:34 ` Dave Chinner
2016-07-13 1:34 ` Dave Chinner
2016-07-13 3:45 ` Dave Chinner
2016-07-13 3:45 ` Dave Chinner
2016-07-13 5:43 ` Jann Horn
2016-07-13 5:43 ` Jann Horn
2016-07-14 17:03 ` Eric W. Biederman
[not found] ` <20160713054358.GB28635-J1fxOzX/cBvk1uMJSBkQmQ@public.gmane.org>
2016-07-14 17:03 ` Eric W. Biederman
2016-07-11 18:12 ` Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 09/12] quota: Handle quota data stored in s_user_ns in quota_setxquota Eric W. Biederman
2016-07-06 18:12 ` [PATCH review 12/12] fs: Update i_[ug]id_(read|write) to translate relative to s_user_ns Eric W. Biederman
-- strict thread matches above, loose matches on Subject: below --
2016-07-02 17:18 [PATCH review 0/11] General unprivileged mount support Eric W. Biederman
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=1467818630.2369.21.camel@HansenPartnership.com \
--to=james.bottomley@hansenpartnership.com \
--cc=containers@lists.linux-foundation.org \
--cc=ebiederm@xmission.com \
--cc=jack@suse.cz \
--cc=jannh@google.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mtk.manpages@gmail.com \
--cc=serge@hallyn.com \
--cc=seth.forshee@canonical.com \
--cc=tixxdz@gmail.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.