Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'pull-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

Pull mount propagation fix from Al Viro:
"6.15 allowed mount propagation to destinations in detached trees;
unfortunately, that breaks existing userland, so the old behaviour
needs to be restored.

It's not exactly a revert - the original behaviour had a bug, where
existence of detached tree might disrupt propagation between locations
not in detached trees. Thankfully, userland did not depend upon that
bug, so we want to keep the fix"

* tag 'pull-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
Don't propagate mounts into detached trees

+4 -20
-5
fs/mount.h
··· 7 7 8 8 extern struct list_head notify_list; 9 9 10 - typedef __u32 __bitwise mntns_flags_t; 11 - 12 - #define MNTNS_PROPAGATING ((__force mntns_flags_t)(1 << 0)) 13 - 14 10 struct mnt_namespace { 15 11 struct ns_common ns; 16 12 struct mount * root; ··· 33 37 struct rb_node mnt_ns_tree_node; /* node in the mnt_ns_tree */ 34 38 struct list_head mnt_ns_list; /* entry in the sequential list of mounts namespace */ 35 39 refcount_t passive; /* number references not pinning @mounts */ 36 - mntns_flags_t mntns_flags; 37 40 } __randomize_layout; 38 41 39 42 struct mnt_pcp {
+2 -13
fs/namespace.c
··· 3649 3649 if (!(attached ? check_mnt(old) : is_anon_ns(ns))) 3650 3650 goto out; 3651 3651 3652 - if (is_anon_ns(ns)) { 3652 + if (is_anon_ns(ns) && ns == p->mnt_ns) { 3653 3653 /* 3654 3654 * Ending up with two files referring to the root of the 3655 3655 * same anonymous mount namespace would cause an error ··· 3657 3657 * twice into the mount tree which would be rejected 3658 3658 * later. But be explicit about it right here. 3659 3659 */ 3660 - if ((is_anon_ns(p->mnt_ns) && ns == p->mnt_ns)) 3661 - goto out; 3662 - 3663 - /* 3664 - * If this is an anonymous mount tree ensure that mount 3665 - * propagation can detect mounts that were just 3666 - * propagated to the target mount tree so we don't 3667 - * propagate onto them. 3668 - */ 3669 - ns->mntns_flags |= MNTNS_PROPAGATING; 3660 + goto out; 3670 3661 } else if (is_anon_ns(p->mnt_ns)) { 3671 3662 /* 3672 3663 * Don't allow moving an attached mount tree to an ··· 3714 3723 if (attached) 3715 3724 put_mountpoint(old_mp); 3716 3725 out: 3717 - if (is_anon_ns(ns)) 3718 - ns->mntns_flags &= ~MNTNS_PROPAGATING; 3719 3726 unlock_mount(mp); 3720 3727 if (!err) { 3721 3728 if (attached) {
+2 -2
fs/pnode.c
··· 231 231 /* skip if mountpoint isn't visible in m */ 232 232 if (!is_subdir(dest_mp->m_dentry, m->mnt.mnt_root)) 233 233 return 0; 234 - /* skip if m is in the anon_ns we are emptying */ 235 - if (m->mnt_ns->mntns_flags & MNTNS_PROPAGATING) 234 + /* skip if m is in the anon_ns */ 235 + if (is_anon_ns(m->mnt_ns)) 236 236 return 0; 237 237 238 238 if (peers(m, last_dest)) {