Util-Linux package development
 help / color / mirror / Atom feed
From: Chris Hofstaedtler <zeha@debian.org>
To: util-linux@vger.kernel.org
Cc: Ralph Ronnquist <ralph@selfhost.au>, 1134639@bugs.debian.org
Subject: Re: Bug#1134639: nsenter -t 1 -m escapes mount and pid namespaces
Date: Wed, 3 Jun 2026 20:17:01 +0200	[thread overview]
Message-ID: <aiBvnWAjX7uu8ydx@per.namespace.at> (raw)
In-Reply-To: <aejkWHDXmpCX7Gh7@smyga.hemma>

Hi Ralph,

sorry for the late reply. I am not an expert on namespaces, and have 
thus forwarded your bug to the upstream mailing list.

On Thu, Apr 23, 2026 at 01:08:08AM +1000, Ralph Ronnquist wrote:
> I observed this ina simple test setup, with on ordinary filesystem
> built with {debootstrap --variant=minbase sid FS ...}
> 
> First: {unshare -m -p -f chroot FS} will change root into that
> filesystem with unshared mount and pid namespaces.
> 
> Next: {mount -t proc proc /proc} will mount the procfs for that pid
> namespace. We see with {ls -l /proc/1/ns/mnt} the identity of the
> unshared mount namespace, which is different from the identity before
> chroot.
> 
> But: {nsenter -t 1 -m -- ls -l /proc/1/ns/mnt} shows the identity of
> the host mount namespace -- the outer namespace.
> 
> Thus {nsenter -t 1 -m} "escapes" from the unshared namespace to the
> containing namespace. And for example: {nsenter -t 1 -m /bin/sh}
> starts a shell in the outer mount and pid namespace(s)!
> 
> This seems to be a severe bug.
> 
> Apparently {nsenter -t 1 -m} finds pid 1 in the outer namespace rather
> than in the call pid namespace.

Hopefully someone from upstream can shed a light :-)

Chris

       reply	other threads:[~2026-06-03 18:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <aejkWHDXmpCX7Gh7@smyga.hemma>
2026-06-03 18:17 ` Chris Hofstaedtler [this message]
2026-06-04  4:03   ` Bug#1134639: nsenter -t 1 -m escapes mount and pid namespaces Christian Albrecht Goeschel Ndjomouo
2026-06-04 10:15     ` Ralph Ronnquist

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=aiBvnWAjX7uu8ydx@per.namespace.at \
    --to=zeha@debian.org \
    --cc=1134639@bugs.debian.org \
    --cc=ralph@selfhost.au \
    --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