diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2016-06-06 16:36:07 -0400 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2016-06-06 21:48:31 -0400 |
commit | 97c1df3e54e811aed484a036a798b4b25d002ecf (patch) | |
tree | a4de3720a182f480db96ea927d1fbbac2e5daf40 | |
parent | af8c34ce6ae32addda3788d54a7e340cad22516b (diff) |
mnt: If fs_fully_visible fails call put_filesystem.
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>
-rw-r--r-- | fs/namespace.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index 4fb1691b4355..9d45c8a3414f 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -2409,8 +2409,10 @@ static int do_new_mount(struct path *path, const char *fstype, int flags, | |||
2409 | mnt_flags |= MNT_NODEV | MNT_LOCK_NODEV; | 2409 | mnt_flags |= MNT_NODEV | MNT_LOCK_NODEV; |
2410 | } | 2410 | } |
2411 | if (type->fs_flags & FS_USERNS_VISIBLE) { | 2411 | if (type->fs_flags & FS_USERNS_VISIBLE) { |
2412 | if (!fs_fully_visible(type, &mnt_flags)) | 2412 | if (!fs_fully_visible(type, &mnt_flags)) { |
2413 | put_filesystem(type); | ||
2413 | return -EPERM; | 2414 | return -EPERM; |
2415 | } | ||
2414 | } | 2416 | } |
2415 | } | 2417 | } |
2416 | 2418 | ||