Skip to content

Commit

Permalink
mnt: Carefully set CL_UNPRIVILEGED in clone_mnt
Browse files Browse the repository at this point in the history
old->mnt_expiry should be ignored unless CL_EXPIRE is set.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
  • Loading branch information
Eric W. Biederman committed Dec 2, 2014
1 parent 8486a78 commit 381cacb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,8 @@ static struct mount *clone_mnt(struct mount *old, struct dentry *root,
}

/* Don't allow unprivileged users to reveal what is under a mount */
if ((flag & CL_UNPRIVILEGED) && list_empty(&old->mnt_expire))
if ((flag & CL_UNPRIVILEGED) &&
(!(flag & CL_EXPIRE) || list_empty(&old->mnt_expire)))
mnt->mnt.mnt_flags |= MNT_LOCKED;

atomic_inc(&sb->s_active);
Expand Down

0 comments on commit 381cacb

Please sign in to comment.