From: Al Viro Date: Sat, 16 Jan 2010 18:07:36 +0000 (-0500) Subject: do_add_mount() should sanitize mnt_flags X-Git-Tag: v2.6.33-rc5~25^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=27d55f1f4c190b14092fcca3069c7d15df83514f;p=profile%2Fivi%2Fkernel-x86-ivi.git 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 --- diff --git a/fs/namespace.c b/fs/namespace.c index 779293e..c768f73 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) &&