linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jann Horn <jannh@google.com>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Laurent Vivier <laurent@vivier.eu>,
	kernel list <linux-kernel@vger.kernel.org>,
	dima@arista.com, Andrei Vagin <avagin@openvz.org>,
	Al Viro <viro@zeniv.linux.org.uk>,
	James Bottomley <James.Bottomley@hansenpartnership.com>,
	containers@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	Linux API <linux-api@vger.kernel.org>
Subject: Re: [RFC v2 v2 1/1] ns: add binfmt_misc to the mount namespace
Date: Wed, 3 Oct 2018 21:26:56 +0200	[thread overview]
Message-ID: <CAG48ez3OrkmBUyL6pS=bSHL-NzdPP8z-tD6hSDYDGyL_R25XDg@mail.gmail.com> (raw)
In-Reply-To: <87o9cbo96j.fsf@xmission.com>

On Wed, Oct 3, 2018 at 8:07 AM Eric W. Biederman <ebiederm@xmission.com> wrote:
> Laurent Vivier <laurent@vivier.eu> writes:
> > This patch allows to have a different binftm_misc configuration
> > in each container we mount binfmt_misc filesystem with mount namespace
> > enabled.
> >
> > A container started without the CLONE_NEWNS will use the host binfmt_misc
> > configuration, otherwise the container starts with an empty binfmt_misc
> > interpreters list.
> >
> > For instance, using "unshare" we can start a chroot of an another
> > architecture and configure the binfmt_misc interpreted without being root
> > to run the binaries in this chroot.
>
> A couple of things.
> As has already been mentioned on your previous version anything that
> comes through the filesystem interface needs to lookup up the local
> binfmt context not through current but through file->f_dentry->d_sb.
> AKA the superblock of the mounted filesystem.

Something else: bm_register_write() currently calls into open_exec(),
which uses the credentials of current. That's not really allowed in
this context - but so far, it's not a big deal because only
init-namespace root can reach this code. Before you expose this stuff
to unprivileged userspace, this needs to get fixed; perhaps by
wrapping the open_exec() call in override_creds(file->f_cred) and
revert_creds().

  reply	other threads:[~2018-10-04  2:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-02 10:20 [RFC v2 v2 0/1] ns: introduce binfmt_misc namespace Laurent Vivier
2018-10-02 10:20 ` [RFC v2 v2 1/1] ns: add binfmt_misc to the mount namespace Laurent Vivier
2018-10-03  6:07   ` Eric W. Biederman
2018-10-03 19:26     ` Jann Horn [this message]
2018-10-02 16:13 ` [RFC v2 v2 0/1] ns: introduce binfmt_misc namespace James Bottomley
2018-10-02 16:47   ` Laurent Vivier
2018-10-03 10:13     ` 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='CAG48ez3OrkmBUyL6pS=bSHL-NzdPP8z-tD6hSDYDGyL_R25XDg@mail.gmail.com' \
    --to=jannh@google.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=avagin@openvz.org \
    --cc=containers@lists.linux-foundation.org \
    --cc=dima@arista.com \
    --cc=ebiederm@xmission.com \
    --cc=laurent@vivier.eu \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --subject='Re: [RFC v2 v2 1/1] ns: add binfmt_misc to the mount namespace' \
    /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

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).