WSL2-Linux-Kernel/fs/exfat
Christian Brauner 2f221d6f7b
attr: handle idmapped mounts
When file attributes are changed most filesystems rely on the
setattr_prepare(), setattr_copy(), and notify_change() helpers for
initialization and permission checking. Let them handle idmapped mounts.
If the inode is accessed through an idmapped mount map it into the
mount's user namespace. Afterwards the checks are identical to
non-idmapped mounts. If the initial user namespace is passed nothing
changes so non-idmapped mounts will see identical behavior as before.

Helpers that perform checks on the ia_uid and ia_gid fields in struct
iattr assume that ia_uid and ia_gid are intended values and have already
been mapped correctly at the userspace-kernelspace boundary as we
already do today. If the initial user namespace is passed nothing
changes so non-idmapped mounts will see identical behavior as before.

Link: https://lore.kernel.org/r/20210121131959.646623-8-christian.brauner@ubuntu.com
Cc: Christoph Hellwig <hch@lst.de>
Cc: David Howells <dhowells@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-24 14:27:16 +01:00
..
Kconfig exfat: Improve wording of EXFAT_DEFAULT_IOCHARSET config option 2020-06-09 16:48:39 +09:00
Makefile exfat: add Kconfig and Makefile 2020-03-05 21:00:40 -05:00
balloc.c exfat: remove EXFAT_SB_DIRTY flag 2020-08-12 08:31:10 +09:00
cache.c exfat: fix use of uninitialized spinlock on error path 2020-10-07 14:27:13 +09:00
dir.c exfat: remove 'rwoffset' in exfat_inode_info 2020-10-22 08:29:11 +09:00
exfat_fs.h exfat: remove 'rwoffset' in exfat_inode_info 2020-10-22 08:29:11 +09:00
exfat_raw.h exfat: retain 'VolumeFlags' properly 2020-08-12 08:31:13 +09:00
fatent.c exfat: optimize exfat_zeroed_cluster() 2020-08-12 08:31:12 +09:00
file.c attr: handle idmapped mounts 2021-01-24 14:27:16 +01:00
inode.c exfat: remove 'rwoffset' in exfat_inode_info 2020-10-22 08:29:11 +09:00
misc.c exfat: write multiple sectors at once 2020-08-12 08:31:11 +09:00
namei.c exfat: remove useless check in exfat_move_file() 2020-10-22 08:29:12 +09:00
nls.c exfat: Avoid allocating upcase table using kcalloc() 2020-12-22 12:31:17 +09:00
super.c Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2020-10-24 12:26:05 -07:00