Commit e4d292ec authored by Al Viro's avatar Al Viro Committed by Stefan Bader

Don't leak MNT_INTERNAL away from internal mounts

BugLink: http://bugs.launchpad.net/bugs/1768429

commit 16a34adb upstream.

We want it only for the stuff created by SB_KERNMOUNT mounts, *not* for
their copies.  As it is, creating a deep stack of bindings of /proc/*/ns/*
somewhere in a new namespace and exiting yields a stack overflow.

Cc: stable@kernel.org
Reported-by: default avatarAlexander Aring <aring@mojatatu.com>
Bisected-by: default avatarKirill Tkhai <ktkhai@virtuozzo.com>
Tested-by: default avatarKirill Tkhai <ktkhai@virtuozzo.com>
Tested-by: default avatarAlexander Aring <aring@mojatatu.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarJuerg Haefliger <juergh@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent a076d865
......@@ -1034,7 +1034,8 @@ static struct mount *clone_mnt(struct mount *old, struct dentry *root,
goto out_free;
}
mnt->mnt.mnt_flags = old->mnt.mnt_flags & ~(MNT_WRITE_HOLD|MNT_MARKED);
mnt->mnt.mnt_flags = old->mnt.mnt_flags;
mnt->mnt.mnt_flags &= ~(MNT_WRITE_HOLD|MNT_MARKED|MNT_INTERNAL);
/* Don't allow unprivileged users to change mount flags */
if (flag & CL_UNPRIVILEGED) {
mnt->mnt.mnt_flags |= MNT_LOCK_ATIME;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment