]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mnt: If fs_fully_visible fails call put_filesystem.
authorEric W. Biederman <ebiederm@xmission.com>
Mon, 6 Jun 2016 20:36:07 +0000 (15:36 -0500)
committerDhaval Giani <dhaval.giani@oracle.com>
Fri, 20 Jan 2017 22:21:55 +0000 (17:21 -0500)
Orabug: 25256941

[ 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>
(cherry picked from commit fced2a819164c305544bcc8d9a45beea15374528)
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
fs/namespace.c

index fce3cc1a3fa771dd5258836efe7185664099c935..2b801290b28623c66bb8e477972992d20fe8262c 100644 (file)
@@ -2390,8 +2390,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;
+                       }
                }
        }