summaryrefslogtreecommitdiffstats
path: root/fs/namespace.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2010-01-16 19:07:36 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2010-01-16 19:07:36 +0100
commit27d55f1f4c190b14092fcca3069c7d15df83514f (patch)
treee0d305a30fa5b5655b87ecc1b50d1664fb4bf70e /fs/namespace.c
parentCIFS shouldn't make mountpoints shrinkable (diff)
downloadlinux-27d55f1f4c190b14092fcca3069c7d15df83514f.tar.xz
linux-27d55f1f4c190b14092fcca3069c7d15df83514f.zip
do_add_mount() should sanitize mnt_flags
MNT_WRITE_HOLD shouldn't leak into new vfsmount and neither should MNT_SHARED (the latter will be set properly, along with the rest of shared-subtree data structures) Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namespace.c')
-rw-r--r--fs/namespace.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 779293e29b85..c768f733c8d6 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1671,6 +1671,8 @@ int do_add_mount(struct vfsmount *newmnt, struct path *path,
{
int err;
+ mnt_flags &= ~(MNT_SHARED | MNT_WRITE_HOLD);
+
down_write(&namespace_sem);
/* Something was mounted here while we slept */
while (d_mountpoint(path->dentry) &&