Skip to content

acl: rework idmap handling when setting posix acls

Christian Brauner linux-fsdevel linux-unionfs ntfs3 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 18 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6ntfs3: rework xattr handlers and switch to POSIX ACL VFS helpersfs/ntfs3/inode.c fs/ntfs3/xattr.c+6 -982 replies
2/6acl: return EOPNOTSUPP in posix_acl_fix_xattr_common()fs/posix_acl.c+9 -162 replies
3/6acl: add vfs_set_acl_prepare()fs/posix_acl.c include/linux/posix_acl_xattr.h+205 -1110 replies
4/6acl: move idmapping handling into posix_acl_xattr_set()fs/posix_acl.c fs/xattr.c security/integrity/evm/evm_main.c+25 -471 reply
5/6ovl: use vfs_set_acl_prepare()fs/overlayfs/super.c+14 -12 replies
6/6xattr: constify value argument in vfs_setxattr()fs/overlayfs/overlayfs.h fs/xattr.c include/linux/xattr.h+4 -51 reply

Reviews trailers per patch

5 of 6 patches have a Reviewed-by or Acked-by.

PatchSeth Forshee (DigitalOcean)Christoph Hellwig
1/6R-b
2/6R-b R-b
3/6
4/6R-b
5/6R-b
6/6R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/6] acl: rework idmap handling when setting posix acls

From: "Christian Brauner (Microsoft)" <[email protected]>

Hey everyone,

As explained in detail in [1] POSIX ACLs are a bit wonky as they abuse the uapi POSIX ACL structure to transport the values of k{g,u}id_t as raw {g,u}id stored in ACL_{GROUP,USER} entries down to the filesystems.

The values stored in the POSIX ACL uapi struct have been mapped into the caller's idmapping in setxattr_convert(). In addition, the VFS needs to take idmapped mounts into during vfs_setxattr(). Currently, it uses the uapi POSIX ACL structure for this as well.

While the handling of idmapped mounts needs to happen in vfs_setxattr() or deeper in its callchain to guarantee that overlayfs handles POSIX ACLs correctly on top of idmapped layers it isn't necessary to further abuse the uapi POSIX ACL structure for this.

Instead of taking idmapped mounts into account and updaing the values in the POSIX ACL uapi struct directly in vfs_setxattr() we can move it down into posix_acl_xattr_set() helper. This allows us to make the value argument of vfs_setxattr() const and gets rid of an additional loop.

Ultimately, we hope to still get rid of the POSIX ACL uapi struct abuse completely but that requires a little more work.

This series also ports ntfs3 to rely on the standard POSXI ACL xattr handler instead of rolling its own (currently broken) implementation.

This survives xfstests and LTP.

Thanks!
Christian

[1]: https://lore.kernel.org/all/[email protected]

Christian Brauner (6):
ntfs3: rework xattr handlers and switch to POSIX ACL VFS helpers
acl: return EOPNOTSUPP in posix_acl_fix_xattr_common()
acl: add vfs_set_acl_prepare()
acl: move idmapping handling into posix_acl_xattr_set()
ovl: use vfs_set_acl_prepare()
xattr: constify value argument in vfs_setxattr()

 fs/ntfs3/inode.c                  |   2 -
 fs/ntfs3/xattr.c                  | 102 +----------
 fs/overlayfs/overlayfs.h          |   2 +-
 fs/overlayfs/super.c              |  15 +-
 fs/posix_acl.c                    | 288 +++++++++++++++++++++++-------
 fs/xattr.c                        |   8 +-
 include/linux/posix_acl_xattr.h   |   3 +
 include/linux/xattr.h             |   2 +-
 security/integrity/evm/evm_main.c |  17 +-
 9 files changed, 262 insertions(+), 177 deletions(-)

base-commit: b90cb1053190353cc30f0fef0ef1f378ccc063c5

Signature · 1 line
2.34.1