Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2016-06-06 15:36:07 -0500
committerSasha Levin <sasha.levin@oracle.com>2016-06-19 23:47:44 -0400
commit7fca87231b6a08e5fe86b02b191527a673f50e71 (patch)
tree4795b18798c28096e33086e6e0699f9527abcf97
parentec5ef4f89be8c7b14deb23a684b6adc3e4c3c220 (diff)
mnt: If fs_fully_visible fails call put_filesystem.
[ Upstream commit 97c1df3e54e811aed484a036a798b4b25d002ecf ] Add this trivial missing error handling. Cc: stable@vger.kernel.org Fixes: 1b852bceb0d1 ("mnt: Refactor the logic for mounting sysfs and proc in a user namespace") Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
-rw-r--r--fs/namespace.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index da23ad8a2c85..b0b78827ec55 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2331,8 +2331,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;
+ }
}
}