diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2019-01-30 13:15:45 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2019-01-30 17:14:50 -0500 |
commit | 3bd045cc9c4be2049602b47505256b43908b4e2f (patch) | |
tree | 37ea999a7cf27e207e4112a9a908c6cab078efd7 /fs/pnode.c | |
parent | 6d7fbce7da0cd06ff3f3f30e009a15a6243f0bc0 (diff) | |
download | linux-stable-3bd045cc9c4be2049602b47505256b43908b4e2f.tar.gz linux-stable-3bd045cc9c4be2049602b47505256b43908b4e2f.tar.bz2 linux-stable-3bd045cc9c4be2049602b47505256b43908b4e2f.zip |
separate copying and locking mount tree on cross-userns copies
Rather than having propagate_mnt() check doing unprivileged copies,
lock them before commit_tree().
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/pnode.c')
-rw-r--r-- | fs/pnode.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/fs/pnode.c b/fs/pnode.c index 1100e810d855..7ea6cfb65077 100644 --- a/fs/pnode.c +++ b/fs/pnode.c @@ -214,7 +214,6 @@ static struct mount *next_group(struct mount *m, struct mount *origin) } /* all accesses are serialized by namespace_sem */ -static struct user_namespace *user_ns; static struct mount *last_dest, *first_source, *last_source, *dest_master; static struct mountpoint *mp; static struct hlist_head *list; @@ -260,9 +259,6 @@ static int propagate_one(struct mount *m) type |= CL_MAKE_SHARED; } - /* Notice when we are propagating across user namespaces */ - if (m->mnt_ns->user_ns != user_ns) - type |= CL_UNPRIVILEGED; child = copy_tree(last_source, last_source->mnt.mnt_root, type); if (IS_ERR(child)) return PTR_ERR(child); @@ -303,7 +299,6 @@ int propagate_mnt(struct mount *dest_mnt, struct mountpoint *dest_mp, * propagate_one(); everything is serialized by namespace_sem, * so globals will do just fine. */ - user_ns = current->nsproxy->mnt_ns->user_ns; last_dest = dest_mnt; first_source = source_mnt; last_source = source_mnt; |