diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2010-01-16 13:07:36 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2010-01-16 13:07:36 -0500 |
commit | 27d55f1f4c190b14092fcca3069c7d15df83514f (patch) | |
tree | e0d305a30fa5b5655b87ecc1b50d1664fb4bf70e /fs | |
parent | 7e1295d9f8300e8c8d1af01765f475621c19ee1d (diff) |
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')
-rw-r--r-- | fs/namespace.c | 2 |
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, | |||
1671 | { | 1671 | { |
1672 | int err; | 1672 | int err; |
1673 | 1673 | ||
1674 | mnt_flags &= ~(MNT_SHARED | MNT_WRITE_HOLD); | ||
1675 | |||
1674 | down_write(&namespace_sem); | 1676 | down_write(&namespace_sem); |
1675 | /* Something was mounted here while we slept */ | 1677 | /* Something was mounted here while we slept */ |
1676 | while (d_mountpoint(path->dentry) && | 1678 | while (d_mountpoint(path->dentry) && |