From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Karel Zak <kzak@redhat.com>
Cc: Linux Containers <containers@lists.linux-foundation.org>,
util-linux@vger.kernel.org
Subject: Re: bind mounting namespace inodes for unprivileged users
Date: Wed, 04 May 2016 09:16:42 -0400 [thread overview]
Message-ID: <1462367802.14310.41.camel@HansenPartnership.com> (raw)
In-Reply-To: <20160504084403.7z67paycj663lkbt@ws.net.home>
On Wed, 2016-05-04 at 10:44 +0200, Karel Zak wrote:
> On Tue, May 03, 2016 at 02:20:56PM -0400, James Bottomley wrote:
> > Right at the moment, unprivileged users cannot call mount --bind to
> > create a permanent copy of any of their namespaces. This is
> > annoying
> > because it means that for entry to long running containers you have
> > to
> > spawn an undying process and use nsenter via the /proc/<pid>/ns
> > files.
>
> Well, unshare is able to create permanent namespaces and the bind
> mounts and nsenter is able to follow these files, but you need root
> permissions to create this stuff.
>
> touch /home/kzak/ns
> sudo unshare --uts=/home/kzak/ns
> <exit namespace>
>
> sudo nsenter --uts=/home/kzak/ns
>
> it means you really do not need any process in the namespace.
Yes, I do this when I'm root.
> Not sure about unprivileged users, it always sounds like a game with
> Pandora's box ;-)
But that's currently my specific problem: binding a container when I'm
an unprivileged user. I was thinking of persuading mount to do it, but
unshare could as well, provided it's setuid root. I'm leery of
proliferating setuid root binaries, which is why I was looking at
mount, but I could easily (more easily than mount) make unshare do it
if that's preferred.
James
next prev parent reply other threads:[~2016-05-04 13:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-03 18:20 bind mounting namespace inodes for unprivileged users James Bottomley
2016-05-03 21:22 ` Serge Hallyn
2016-05-04 11:15 ` James Bottomley
2016-05-04 8:44 ` Karel Zak
2016-05-04 13:16 ` James Bottomley [this message]
2016-05-04 14:38 ` Eric W. Biederman
2016-05-04 17:28 ` James Bottomley
2016-05-04 17:43 ` Eric W. Biederman
2016-05-04 18:00 ` 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=1462367802.14310.41.camel@HansenPartnership.com \
--to=james.bottomley@hansenpartnership.com \
--cc=containers@lists.linux-foundation.org \
--cc=kzak@redhat.com \
--cc=util-linux@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