瀏覽代碼

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>
Al Viro 15 年之前
父節點
當前提交
27d55f1f4c
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      fs/namespace.c

+ 2 - 0
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) &&