linux/fs/overlayfs
Tycho Andersen c7c7a1a18a
xattr: handle idmapped mounts
When interacting with extended attributes the vfs verifies that the
caller is privileged over the inode with which the extended attribute is
associated. For posix access and posix default extended attributes a uid
or gid can be stored on-disk. Let the functions handle posix extended
attributes on idmapped mounts. If the inode is accessed through an
idmapped mount we need to map it according to the mount's user
namespace. Afterwards the checks are identical to non-idmapped mounts.
This has no effect for e.g. security xattrs since they don't store uids
or gids and don't perform permission checks on them like posix acls do.

Link: https://lore.kernel.org/r/20210121131959.646623-10-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>
Reviewed-by: James Morris <jamorris@linux.microsoft.com>
Signed-off-by: Tycho Andersen <tycho@tycho.pizza>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-24 14:27:17 +01:00
..
copy_up.c xattr: handle idmapped mounts 2021-01-24 14:27:17 +01:00
dir.c xattr: handle idmapped mounts 2021-01-24 14:27:17 +01:00
export.c ovl: propagate ovl_fs to ovl_decode_real_fh and ovl_encode_real_fh 2020-11-12 11:31:55 +01:00
file.c inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
inode.c xattr: handle idmapped mounts 2021-01-24 14:27:17 +01:00
Kconfig docs: fix broken references to text files 2020-04-20 15:35:59 -06:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
namei.c ovl: check privs before decoding file handle 2020-12-14 15:26:14 +01:00
overlayfs.h xattr: handle idmapped mounts 2021-01-24 14:27:17 +01:00
ovl_entry.h ovl: user xattr 2020-12-14 15:26:14 +01:00
readdir.c ovl: support [S|G]ETFLAGS and FS[S|G]ETXATTR ioctls for directories 2020-10-06 15:38:14 +02:00
super.c xattr: handle idmapped mounts 2021-01-24 14:27:17 +01:00
util.c inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00