Skip to content

Commit

Permalink
do_add_mount() should sanitize mnt_flags
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Al Viro committed Jan 16, 2010
1 parent 7e1295d commit 27d55f1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) &&
Expand Down

0 comments on commit 27d55f1

Please sign in to comment.