]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.6.5/mnt-if-fs_fully_visible-fails-call-put_filesystem.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.6.5 / mnt-if-fs_fully_visible-fails-call-put_filesystem.patch
CommitLineData
700b5fa6
GKH
1From 97c1df3e54e811aed484a036a798b4b25d002ecf Mon Sep 17 00:00:00 2001
2From: "Eric W. Biederman" <ebiederm@xmission.com>
3Date: Mon, 6 Jun 2016 15:36:07 -0500
4Subject: mnt: If fs_fully_visible fails call put_filesystem.
5
6From: Eric W. Biederman <ebiederm@xmission.com>
7
8commit 97c1df3e54e811aed484a036a798b4b25d002ecf upstream.
9
10Add this trivial missing error handling.
11
12Fixes: 1b852bceb0d1 ("mnt: Refactor the logic for mounting sysfs and proc in a user namespace")
13Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
14Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
15
16---
17 fs/namespace.c | 4 +++-
18 1 file changed, 3 insertions(+), 1 deletion(-)
19
20--- a/fs/namespace.c
21+++ b/fs/namespace.c
22@@ -2409,8 +2409,10 @@ static int do_new_mount(struct path *pat
23 mnt_flags |= MNT_NODEV | MNT_LOCK_NODEV;
24 }
25 if (type->fs_flags & FS_USERNS_VISIBLE) {
26- if (!fs_fully_visible(type, &mnt_flags))
27+ if (!fs_fully_visible(type, &mnt_flags)) {
28+ put_filesystem(type);
29 return -EPERM;
30+ }
31 }
32 }
33