Skip to content

Commit 29f785f

Browse files
committed
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs fixes from Al Viro: "MS_MOVE regression fix + breakage in fsmount(2) (also introduced in this cycle, along with fsmount(2) itself). I'm still digging through the piles of mail, so there might be more fixes to follow, but these two are obvious and self-contained, so there's no point delaying those..." * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: fs/namespace: fix unprivileged mount propagation vfs: fsmount: add missing mntget()
2 parents da0f382 + d728cf7 commit 29f785f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

fs/namespace.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2105,6 +2105,7 @@ static int attach_recursive_mnt(struct mount *source_mnt,
21052105
/* Notice when we are propagating across user namespaces */
21062106
if (child->mnt_parent->mnt_ns->user_ns != user_ns)
21072107
lock_mnt_tree(child);
2108+
child->mnt.mnt_flags &= ~MNT_LOCKED;
21082109
commit_tree(child);
21092110
}
21102111
put_mountpoint(smp);
@@ -3445,6 +3446,7 @@ SYSCALL_DEFINE3(fsmount, int, fs_fd, unsigned int, flags,
34453446
ns->root = mnt;
34463447
ns->mounts = 1;
34473448
list_add(&mnt->mnt_list, &ns->list);
3449+
mntget(newmount.mnt);
34483450

34493451
/* Attach to an apparent O_PATH fd with a note that we need to unmount
34503452
* it, not just simply put it.

fs/pnode.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ static int propagate_one(struct mount *m)
261261
child = copy_tree(last_source, last_source->mnt.mnt_root, type);
262262
if (IS_ERR(child))
263263
return PTR_ERR(child);
264-
child->mnt.mnt_flags &= ~MNT_LOCKED;
265264
mnt_set_mountpoint(m, mp, child);
266265
last_dest = m;
267266
last_source = child;

0 commit comments

Comments
 (0)