]>
Commit | Line | Data |
---|---|---|
700b5fa6 GKH |
1 | From 97c1df3e54e811aed484a036a798b4b25d002ecf Mon Sep 17 00:00:00 2001 |
2 | From: "Eric W. Biederman" <ebiederm@xmission.com> | |
3 | Date: Mon, 6 Jun 2016 15:36:07 -0500 | |
4 | Subject: mnt: If fs_fully_visible fails call put_filesystem. | |
5 | ||
6 | From: Eric W. Biederman <ebiederm@xmission.com> | |
7 | ||
8 | commit 97c1df3e54e811aed484a036a798b4b25d002ecf upstream. | |
9 | ||
10 | Add this trivial missing error handling. | |
11 | ||
12 | Fixes: 1b852bceb0d1 ("mnt: Refactor the logic for mounting sysfs and proc in a user namespace") | |
13 | Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> | |
14 | Signed-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 |