Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7fca8723 authored by Eric W. Biederman's avatar Eric W. Biederman Committed by Sasha Levin
Browse files

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: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
parent ec5ef4f8
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -2331,10 +2331,12 @@ 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;
			}
		}
	}

	mnt = vfs_kern_mount(type, flags, name, data);
	if (!IS_ERR(mnt) && (type->fs_flags & FS_HAS_SUBTYPE) &&