WSL2-Linux-Kernel/fs
Christian Brauner 21cb47be6f
inode: make init and permission helpers idmapped mount aware
The inode_owner_or_capable() helper determines whether the caller is the
owner of the inode or is capable with respect to that inode. Allow it to
handle idmapped mounts. If the inode is accessed through an idmapped
mount it according to 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.

Similarly, allow the inode_init_owner() helper to handle idmapped
mounts. It initializes a new inode on idmapped mounts by mapping the
fsuid and fsgid of the caller from the mount's user namespace. 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-7-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: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-24 14:27:16 +01:00
..
9p inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
adfs
affs
afs afs: Fix directory entry size calculation 2021-01-04 12:25:19 +00:00
autofs
befs
bfs inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
btrfs inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
cachefiles
ceph namei: make permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
cifs namei: make permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
coda
configfs namei: make permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
cramfs
crypto inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
debugfs
devpts
dlm
ecryptfs namei: make permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
efivarfs inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
efs
erofs
exfat exfat: Avoid allocating upcase table using kcalloc() 2020-12-22 12:31:17 +09:00
exportfs
ext2 inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
ext4 inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
f2fs inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
fat
freevxfs
fscache
fuse namei: make permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
gfs2 inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
hfs
hfsplus inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
hostfs namei: make permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
hpfs
hugetlbfs inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
iomap
isofs
jbd2 jbd2: add a helper to find out number of fast commit blocks 2020-12-17 13:30:45 -05:00
jffs2
jfs inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
kernfs namei: make permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
lockd fs/lockd: convert comma to semicolon 2020-12-16 07:57:37 -05:00
minix inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
nfs namei: make permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
nfs_common
nfsd namei: make permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
nilfs2 inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
nls
notify fs: add file and path permissions helpers 2021-01-24 14:27:16 +01:00
ntfs fs/ntfs: remove unused variable attr_len 2020-12-15 12:13:37 -08:00
ocfs2 inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
omfs inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
openpromfs
orangefs namei: make permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
overlayfs inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
proc namei: make permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
pstore Tracing updates for 5.11 2020-12-17 13:22:17 -08:00
qnx4
qnx6
quota \n 2020-12-17 11:00:37 -08:00
ramfs inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
reiserfs inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
romfs
squashfs
sysfs
sysv inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
tracefs
ubifs inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
udf inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
ufs inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
unicode
vboxsf
verity fs: add file and path permissions helpers 2021-01-24 14:27:16 +01:00
xfs inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
zonefs inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
Kconfig
Kconfig.binfmt
Makefile
aio.c Merge branch 'akpm' (patches from Andrew) 2020-12-15 12:53:37 -08:00
anon_inodes.c
attr.c inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
bad_inode.c
binfmt_aout.c
binfmt_elf.c Merge branch 'exec-for-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2020-12-15 19:29:43 -08:00
binfmt_elf_fdpic.c
binfmt_em86.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
block_dev.c block: pre-initialize struct block_device in bdev_alloc_inode 2021-01-07 20:57:53 -07:00
buffer.c for-5.11/block-2020-12-14 2020-12-16 12:57:51 -08:00
char_dev.c
compat_binfmt_elf.c
coredump.c Merge branch 'exec-for-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2020-12-15 19:29:43 -08:00
d_path.c
dax.c mm: simplify follow_pte{,pmd} 2020-12-15 22:46:19 -08:00
dcache.c
dcookies.c
direct-io.c
drop_caches.c
eventfd.c
eventpoll.c epoll: add syscall epoll_pwait2 2020-12-19 11:18:38 -08:00
exec.c namei: make permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
fcntl.c inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
fhandle.c
file.c kernel/io_uring: cancel io_uring before task works 2020-12-30 19:36:54 -07:00
file_table.c
filesystems.c
fs-writeback.c writeback: don't warn on an unregistered BDI in __mark_inode_dirty 2020-12-16 11:56:02 +01:00
fs_context.c
fs_parser.c
fs_pin.c
fs_struct.c
fs_types.c
fsopen.c
init.c fs: add file and path permissions helpers 2021-01-24 14:27:16 +01:00
inode.c inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
internal.h for-5.11/block-2020-12-14 2020-12-16 12:57:51 -08:00
io-wq.c io-wq: kill now unused io_wq_cancel_all() 2020-12-20 10:47:42 -07:00
io-wq.h io-wq: kill now unused io_wq_cancel_all() 2020-12-20 10:47:42 -07:00
io_uring.c io_uring: ensure finish_wait() is always called in __io_uring_task_cancel() 2021-01-15 16:04:23 -07:00
ioctl.c
kernel_read_file.c
libfs.c namei: make permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
locks.c Merge branch 'exec-for-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2020-12-15 19:29:43 -08:00
mbcache.c
mount.h
mpage.c
namei.c inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
namespace.c mount: attach mappings to mounts 2021-01-24 14:27:15 +01:00
no-block.c
nsfs.c
open.c namei: make permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
pipe.c
pnode.c
pnode.h
posix_acl.c inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
proc_namespace.c proc mountinfo: make splice available again 2020-12-27 12:00:36 -08:00
read_write.c
readdir.c
remap_range.c namei: make permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
select.c poll: fix performance regression due to out-of-line __put_user() 2021-01-08 11:06:29 -08:00
seq_file.c
signalfd.c
splice.c
stack.c
stat.c
statfs.c
super.c
sync.c
timerfd.c
userfaultfd.c userfaultfd: add user-mode only option to unprivileged_userfaultfd sysctl knob 2020-12-15 12:13:46 -08:00
utimes.c
xattr.c inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00