diff options
Diffstat (limited to 'fs/pnode.c')
-rw-r--r-- | fs/pnode.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/pnode.c b/fs/pnode.c index 3e000a51ac0d..8b29d2164da6 100644 --- a/fs/pnode.c +++ b/fs/pnode.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/mnt_namespace.h> | 9 | #include <linux/mnt_namespace.h> |
10 | #include <linux/mount.h> | 10 | #include <linux/mount.h> |
11 | #include <linux/fs.h> | 11 | #include <linux/fs.h> |
12 | #include <linux/nsproxy.h> | ||
12 | #include "internal.h" | 13 | #include "internal.h" |
13 | #include "pnode.h" | 14 | #include "pnode.h" |
14 | 15 | ||
@@ -220,6 +221,7 @@ static struct mount *get_source(struct mount *dest, | |||
220 | int propagate_mnt(struct mount *dest_mnt, struct dentry *dest_dentry, | 221 | int propagate_mnt(struct mount *dest_mnt, struct dentry *dest_dentry, |
221 | struct mount *source_mnt, struct list_head *tree_list) | 222 | struct mount *source_mnt, struct list_head *tree_list) |
222 | { | 223 | { |
224 | struct user_namespace *user_ns = current->nsproxy->mnt_ns->user_ns; | ||
223 | struct mount *m, *child; | 225 | struct mount *m, *child; |
224 | int ret = 0; | 226 | int ret = 0; |
225 | struct mount *prev_dest_mnt = dest_mnt; | 227 | struct mount *prev_dest_mnt = dest_mnt; |
@@ -237,6 +239,10 @@ int propagate_mnt(struct mount *dest_mnt, struct dentry *dest_dentry, | |||
237 | 239 | ||
238 | source = get_source(m, prev_dest_mnt, prev_src_mnt, &type); | 240 | source = get_source(m, prev_dest_mnt, prev_src_mnt, &type); |
239 | 241 | ||
242 | /* Notice when we are propagating across user namespaces */ | ||
243 | if (m->mnt_ns->user_ns != user_ns) | ||
244 | type |= CL_UNPRIVILEGED; | ||
245 | |||
240 | child = copy_tree(source, source->mnt.mnt_root, type); | 246 | child = copy_tree(source, source->mnt.mnt_root, type); |
241 | if (IS_ERR(child)) { | 247 | if (IS_ERR(child)) { |
242 | ret = PTR_ERR(child); | 248 | ret = PTR_ERR(child); |