Commit d2a4a177 authored by Alexander Viro's avatar Alexander Viro Committed by David S. Miller

[PATCH] missing check in do_add_mount()

Make sure that we don't end up with symlink mounted over something

(mount --bind is safe since we use LOOKUP_FOLLOW in pathname resolution
there).
parent 4143a413
......@@ -681,6 +681,10 @@ static int do_add_mount(struct nameidata *nd, char *type, int flags,
if (nd->mnt->mnt_sb == mnt->mnt_sb && nd->mnt->mnt_root == nd->dentry)
goto unlock;
err = -EINVAL;
if (S_ISLNK(mnt->mnt_root->d_inode->i_mode))
goto unlock;
mnt->mnt_flags = mnt_flags;
err = graft_tree(mnt, nd);
unlock:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment