The commit is pushed to "branch-rh7-3.10.0-693.21.1.vz7.47.x-ovz" and will
appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-693.21.1.vz7.47.1
------>
commit 4f34ee3327bedea25f0057a123b9fb7621e62cf7
Author: Al Viro <[email protected]>
Date: Fri Apr 27 13:13:20 2018 +0300
ms/fs: Don't leak MNT_INTERNAL away from internal mounts
commit 16a34adb9392b2fe4195267475ab5b472e55292c 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: [email protected]
Reported-by: Alexander Aring <[email protected]>
Bisected-by: Kirill Tkhai <[email protected]>
Tested-by: Kirill Tkhai <[email protected]>
Tested-by: Alexander Aring <[email protected]>
Signed-off-by: Al Viro <[email protected]>
[Problem commit existing in our kernel,
but it doesn't reproduce with our config:
https://www.spinics.net/lists/netdev/msg496514.html]
Signed-off-by: Kirill Tkhai <[email protected]>
---
fs/namespace.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/namespace.c b/fs/namespace.c
index 46b521b8d16a..98e5fb577e15 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1014,7 +1014,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_READONLY))
mnt->mnt.mnt_flags |= MNT_LOCK_READONLY;
_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel