From: Al Viro <viro@zeniv.linux.org.uk>
To: Christian Brauner <christian@brauner.io>
Cc: torvalds@linux-foundation.org, ebiederm@xmission.com,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH v1] fs/namespace: fix unprivileged mount propagation
Date: Mon, 17 Jun 2019 22:32:11 +0100 [thread overview]
Message-ID: <20190617213211.GV17978@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20190617212214.29868-1-christian@brauner.io>
On Mon, Jun 17, 2019 at 11:22:14PM +0200, Christian Brauner wrote:
> When propagating mounts across mount namespaces owned by different user
> namespaces it is not possible anymore to move or umount the mount in the
> less privileged mount namespace.
>
> Here is a reproducer:
>
> sudo mount -t tmpfs tmpfs /mnt
> sudo --make-rshared /mnt
>
> # create unprivileged user + mount namespace and preserve propagation
> unshare -U -m --map-root --propagation=unchanged
>
> # now change back to the original mount namespace in another terminal:
> sudo mkdir /mnt/aaa
> sudo mount -t tmpfs tmpfs /mnt/aaa
>
> # now in the unprivileged user + mount namespace
> mount --move /mnt/aaa /opt
>
> Unfortunately, this is a pretty big deal for userspace since this is
> e.g. used to inject mounts into running unprivileged containers.
> So this regression really needs to go away rather quickly.
>
> The problem is that a recent change falsely locked the root of the newly
> added mounts by setting MNT_LOCKED. Fix this by only locking the mounts
> on copy_mnt_ns() and not when adding a new mount.
Applied. Linus, if you want to apply it directly, feel free to add my
Acked-by. Alternatively, wait until tonight and I'll send a pull request
with that (as well as missing mntget() in fsmount(2) fix, at least).
Al, down to ~3Kmail in the pile...
next prev parent reply other threads:[~2019-06-17 21:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-17 21:22 [PATCH v1] fs/namespace: fix unprivileged mount propagation Christian Brauner
2019-06-17 21:32 ` Al Viro [this message]
2019-06-17 23:29 ` Linus Torvalds
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=20190617213211.GV17978@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=christian@brauner.io \
--cc=ebiederm@xmission.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).