1
0
Fork 0

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>
hifive-unleashed-5.1
Al Viro 2010-01-16 13:07:36 -05:00
parent 7e1295d9f8
commit 27d55f1f4c
1 changed files with 2 additions and 0 deletions

View File

@ -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) &&