Skip to content

Commit

Permalink
mnt: If fs_fully_visible fails call put_filesystem.
Browse files Browse the repository at this point in the history
Add this trivial missing error handling.

Cc: stable@vger.kernel.org
Fixes: 1b852bc ("mnt: Refactor the logic for mounting sysfs and proc in a user namespace")
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
  • Loading branch information
Eric W. Biederman committed Jun 7, 2016
1 parent af8c34c commit 97c1df3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -2409,8 +2409,10 @@ static int do_new_mount(struct path *path, const char *fstype, int flags,
mnt_flags |= MNT_NODEV | MNT_LOCK_NODEV;
}
if (type->fs_flags & FS_USERNS_VISIBLE) {
if (!fs_fully_visible(type, &mnt_flags))
if (!fs_fully_visible(type, &mnt_flags)) {
put_filesystem(type);
return -EPERM;
}
}
}

Expand Down

0 comments on commit 97c1df3

Please sign in to comment.