linux/fs/ntfs3
Christian Brauner 0c3bc7899e
ntfs: fix acl handling
While looking at our current POSIX ACL handling in the context of some
overlayfs work I went through a range of other filesystems checking how they
handle them currently and encountered ntfs3.

The posic_acl_{from,to}_xattr() helpers always need to operate on the
filesystem idmapping. Since ntfs3 can only be mounted in the initial user
namespace the relevant idmapping is init_user_ns.

The posix_acl_{from,to}_xattr() helpers are concerned with translating between
the kernel internal struct posix_acl{_entry} and the uapi struct
posix_acl_xattr_{header,entry} and the kernel internal data structure is cached
filesystem wide.

Additional idmappings such as the caller's idmapping or the mount's idmapping
are handled higher up in the VFS. Individual filesystems usually do not need to
concern themselves with these.

The posix_acl_valid() helper is concerned with checking whether the values in
the kernel internal struct posix_acl can be represented in the filesystem's
idmapping. IOW, if they can be written to disk. So this helper too needs to
take the filesystem's idmapping.

Fixes: be71b5cba2 ("fs/ntfs3: Add attrib operations")
Cc: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Cc: ntfs3@lists.linux.dev
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
2022-08-22 12:52:23 +02:00
..
lib fs/ntfs3: Add missing header and guards to lib/ headers 2021-09-13 19:41:44 +03:00
attrib.c fs/ntfs3: Keep prealloc for all types of files 2021-10-11 19:10:19 +03:00
attrlist.c fs/ntfs3: Add sync flag to ntfs_sb_write_run and al_update 2021-09-21 18:37:01 +03:00
bitfunc.c fs/ntfs3: Remove a useless shadowing variable 2021-09-23 19:05:46 +03:00
bitmap.c fs/ntfs3: Use min/max macros instated of ternary operators 2021-09-16 17:01:37 +03:00
debug.h fs/ntfs3. Add forward declarations for structs to debug.h 2021-09-13 19:41:43 +03:00
dir.c fs/ntfs3: Rework ntfs_utf16_to_nls 2021-10-11 19:28:04 +03:00
file.c fs/buffer: Combine two submit_bh() and ll_rw_block() arguments 2022-07-14 12:14:32 -06:00
frecord.c fs/ntfs3: Fix fiemap + fix shrink file size (to remove preallocated space) 2021-11-24 15:13:26 +03:00
fslog.c fs/ntfs3: Fix invalid free in log_replay 2022-05-31 17:29:29 +03:00
fsntfs.c fs/ntfs3: Use enum req_op where appropriate 2022-07-14 12:14:33 -06:00
index.c fs/ntfs3: Remove a useless test in 'indx_find()' 2021-09-23 19:05:25 +03:00
inode.c Folio changes for 6.0 2022-08-03 10:35:43 -07:00
Kconfig
lznt.c fs/ntfs3: Remove tabs before spaces from comment 2021-09-16 17:01:36 +03:00
Makefile
namei.c fs/ntfs3: Move ni_lock_dir and ni_unlock into ntfs_create_inode 2021-09-24 17:39:57 +03:00
ntfs_fs.h Folio changes for 6.0 2022-08-03 10:35:43 -07:00
ntfs.h fs/ntfs3: Change max hardlinks limit to 4000 2021-09-21 18:37:01 +03:00
record.c fs/ntfs3: Remove unneeded header files from c files 2021-09-13 19:41:46 +03:00
run.c fs/ntfs3: Remove unneeded header files from c files 2021-09-13 19:41:46 +03:00
super.c Not a lot of material this cycle. Many singleton patches against various 2022-05-27 11:22:03 -07:00
upcase.c fs/ntfs3: Change right headers to upcase.c 2021-09-13 19:41:45 +03:00
xattr.c ntfs: fix acl handling 2022-08-22 12:52:23 +02:00