linux/fs/fuse
Eric Sandeen 0457e54a9e fuse: verify {g,u}id mount options correctly
commit 525bd65aa7 upstream.

As was done in
0200679fc7 ("tmpfs: verify {g,u}id mount options correctly")
we need to validate that the requested uid and/or gid is representable in
the filesystem's idmapping.

Cribbing from the above commit log,

The contract for {g,u}id mount options and {g,u}id values in general set
from userspace has always been that they are translated according to the
caller's idmapping. In so far, fuse has been doing the correct thing.
But since fuse is mountable in unprivileged contexts it is also
necessary to verify that the resulting {k,g}uid is representable in the
namespace of the superblock.

Fixes: c30da2e981 ("fuse: convert to use the new mount API")
Cc: stable@vger.kernel.org # 5.4+
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Link: https://lore.kernel.org/r/8f07d45d-c806-484d-a2e3-7a2199df1cd2@redhat.com
Reviewed-by: Christian Brauner <brauner@kernel.org>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-08-03 08:49:31 +02:00
..
acl.c vfs: add rcu argument to ->get_acl() callback 2021-08-18 22:08:24 +02:00
control.c fuse: Remove the control interface for virtio-fs 2022-07-21 16:06:19 +02:00
cuse.c cuse: simplify refcount 2021-04-14 10:40:58 +02:00
dax.c fuse: dax: set fc->dax to NULL in fuse_dax_conn_free() 2023-12-20 17:00:20 +01:00
dev.c mm: multi-gen LRU: groundwork 2022-09-26 19:46:09 -07:00
dir.c fuse: fix root lookup with nonzero generation 2024-04-03 15:19:30 +02:00
file.c attr: use consistent sgid stripping checks 2023-03-03 11:52:25 +01:00
fuse_i.h fuse: don't unhash root 2024-04-03 15:19:30 +02:00
inode.c fuse: verify {g,u}id mount options correctly 2024-08-03 08:49:31 +02:00
ioctl.c fuse: ioctl: translate ENOSYS in outarg 2023-07-27 08:50:25 +02:00
Kconfig dax: remove CONFIG_DAX_DRIVER 2021-12-04 08:58:51 -08:00
Makefile fuse: move ioctl to separate source file 2021-04-12 15:04:30 +02:00
readdir.c fuse: nlookup missing decrement in fuse_direntplus_link 2023-09-19 12:28:05 +02:00
virtio_fs.c virtio_fs: Modify format for virtio_fs_direct_access 2022-07-26 10:38:58 +02:00
xattr.c fuse: move fuse_invalidate_attr() into fuse_update_ctime() 2021-10-22 17:03:01 +02:00