All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: util-linux@vger.kernel.org
Cc: ebiederm@xmission.com
Subject: Re: [PATCH] nsenter: fix ability to enter unprivileged containers
Date: Mon, 18 Apr 2016 11:50:19 -0400	[thread overview]
Message-ID: <1460994619.7385.14.camel@HansenPartnership.com> (raw)
In-Reply-To: <1460993854.7385.11.camel@HansenPartnership.com>

On Mon, 2016-04-18 at 11:37 -0400, James Bottomley wrote:
> > # nsenter --mount=/run/build-container/aarch64 nsenter -
> > -user=/dev/fd/3 3&lt;/run/build-container/user
> 
> It should work, but for some inexplicable reason it's giving EINVAL.
> 
> # nsenter --mount=/run/build-container/aarch64 3</run/build
> -container/user 
> # ls -l /proc/self/fd
> total 0
> lrwx------ 1 root root 64 Apr 18 15:31 0 -> /dev/pts/1
> lrwx------ 1 root root 64 Apr 18 15:31 1 -> /dev/pts/1
> lrwx------ 1 root root 64 Apr 18 15:31 2 -> /dev/pts/1
> lr-x------ 1 root root 64 Apr 18 15:31 3 -> /run/build-container/user
> lr-x------ 1 root root 64 Apr 18 15:31 4 -> /proc/10304/fd
> # nsenter --user=/proc/self/fd/3
> nsenter: reassociate to namespace 'ns/user' failed: Invalid argument
> 
> I think it's because the fd wasn't properly opened by the shell

Actually, just to follow up, this is specifically a problem of the type
of container I'm running: it's actually an architecture emulation
container, so after I've done the mount namespace enter, I'm running
under aarch64 emulation and, apparently, qemu has some problem with the
setns system call.  This does, however, mean I have to enter both
namespaces together ...

James


  reply	other threads:[~2016-04-18 15:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-18 12:26 [PATCH] nsenter: fix ability to enter unprivileged containers James Bottomley
2016-04-18 14:33 ` Yuriy M. Kaminskiy
2016-04-18 15:51   ` Yuriy M. Kaminskiy
2016-04-18 15:37 ` James Bottomley
2016-04-18 15:50   ` James Bottomley [this message]
2016-04-18 17:11   ` Karel Zak
2016-04-18 17:28     ` James Bottomley
2016-04-18 18:26       ` Eric W. Biederman
2016-04-18 20:56         ` James Bottomley
2016-04-18 21:31           ` Eric W. Biederman
2016-04-22  9:05           ` Karel Zak
2016-04-18 19:40     ` 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=1460994619.7385.14.camel@HansenPartnership.com \
    --to=james.bottomley@hansenpartnership.com \
    --cc=ebiederm@xmission.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 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.