From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Tycho Andersen <tycho@tycho.ws>
Cc: "Serge E. Hallyn" <serge@hallyn.com>,
Miklos Szeredi <miklos@szeredi.hu>,
containers@lists.linux-foundation.org,
linux-unionfs@vger.kernel.org,
David Howells <dhowells@redhat.com>,
Seth Forshee <seth.forshee@canonical.com>,
Eric Biederman <ebiederm@xmission.com>,
linux-fsdevel@vger.kernel.org, Al Viro <viro@ZenIV.linux.org.uk>
Subject: Re: [PATCH v2 2/3] fs: introduce uid/gid shifting bind mount
Date: Fri, 17 Jan 2020 14:52:52 -0800 [thread overview]
Message-ID: <1579301572.13499.7.camel@HansenPartnership.com> (raw)
In-Reply-To: <20200117211940.GA22062@cisco>
On Fri, 2020-01-17 at 13:19 -0800, Tycho Andersen wrote:
> On Fri, Jan 17, 2020 at 08:25:42AM -0800, James Bottomley wrote:
> > On Fri, 2020-01-17 at 09:44 -0600, Serge E. Hallyn wrote:
> > > On Thu, Jan 16, 2020 at 08:29:33AM -0800, James Bottomley wrote:
> > > I guess I figured we would have privileged task in the owning
> > > namespace (presumably init_user_ns) mark a bind mount as
> > > shiftable
> >
> > Yes, that's what I've got today in the prototype. It mirrors the
> > original shiftfs mechanism. However, I have also heard people say
> > they want a permanent mark, like an xattr for this.
>
> Please, no. mount() failures are already hard to reason about, I
> would rather not add another temporary (or worse, permanent) non-
> obvious failure mode.
I'm not particularly bothered either way ... although using xattrs
always seems to end up biting us for nesting, so I wasn't wildly
enthusiastic about it.
> What if we make shifted bind mounts always readonly? That will force
> people to use an overlay (or something else) on top, but they
> probably want to do that anyway so they can avoid tainting the
> original container image with writes.
That really causes problems for the mutable (non-docker) container use
case which is pretty much the way I always use containers. Who wants
to bother with overlayfs when their image is expected to mutate: it's
just a huge hassle.
> > > Oh - I consider the detail of whether we pass a userid or userns
> > > nsfd as more of an implementation detail which we can hash out
> > > after the more general shift-mount api is decided upon. Anyway,
> > > passing nsfds just has a cool factor :)
> >
> > Well, yes, won't aruge on the cool factor-ness.
>
> It's not just the cool factor: if you're doing this, it's presumably
> because you want to use it with a container in a user namespace.
> Specifying the same parameters twice leaves room for error, causing
> CVEs and more work.
It depends. For the offset, we agreed there's no extant user_ns, so
you have to create one specifically. That leads to a more error prone
setup with no actual checking benefit.
For the shift_ns, it depends whether you want one mount point per
tenant, in which case the tenant user_ns might be a useful check, or
one mount point with an ACL in which case you just backshift along the
binding tenant user_ns.
James
next prev parent reply other threads:[~2020-01-17 22:52 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-04 20:39 [PATCH v2 0/3] introduce a uid/gid shifting bind mount James Bottomley
2020-01-04 20:39 ` [PATCH v2 1/3] fs: rethread notify_change to take a path instead of a dentry James Bottomley
2020-01-04 21:52 ` Amir Goldstein
2020-01-04 20:39 ` [PATCH v2 2/3] fs: introduce uid/gid shifting bind mount James Bottomley
2020-01-04 23:09 ` Amir Goldstein
2020-01-05 17:44 ` James Bottomley
2020-01-13 3:41 ` Serge E. Hallyn
2020-01-15 18:19 ` James Bottomley
2020-01-16 6:44 ` Serge E. Hallyn
2020-01-16 16:29 ` James Bottomley
2020-01-17 15:44 ` Serge E. Hallyn
2020-01-17 16:25 ` James Bottomley
2020-01-17 21:19 ` Tycho Andersen
2020-01-17 21:33 ` Brian Goff
2020-01-17 22:52 ` James Bottomley [this message]
2020-01-04 20:39 ` [PATCH v2 3/3] fs: expose shifting bind mount to userspace James Bottomley
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=1579301572.13499.7.camel@HansenPartnership.com \
--to=james.bottomley@hansenpartnership.com \
--cc=containers@lists.linux-foundation.org \
--cc=dhowells@redhat.com \
--cc=ebiederm@xmission.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-unionfs@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=serge@hallyn.com \
--cc=seth.forshee@canonical.com \
--cc=tycho@tycho.ws \
--cc=viro@ZenIV.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).