aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/tcp.h
diff options
context:
space:
mode:
authorChristian Brauner <christian@brauner.io>2019-06-17 23:22:14 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2019-06-17 17:36:09 -0400
commitd728cf79164bb38e9628d15276e636539f857ef1 (patch)
tree228beb2df439ab3d53eb0ac147a8cbb0dacb65d4 /include/net/tcp.h
parentvfs: fsmount: add missing mntget() (diff)
downloadlinux-dev-d728cf79164bb38e9628d15276e636539f857ef1.tar.xz
linux-dev-d728cf79164bb38e9628d15276e636539f857ef1.zip
fs/namespace: fix unprivileged mount propagation
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. Fixes: 3bd045cc9c4b ("separate copying and locking mount tree on cross-userns copies") Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: <stable@vger.kernel.org> Tested-by: Christian Brauner <christian@brauner.io> Acked-by: Christian Brauner <christian@brauner.io> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Christian Brauner <christian@brauner.io> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/net/tcp.h')
0 files changed, 0 insertions, 0 deletions