linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] acl: rework idmap handling when setting posix acls
@ 2022-08-29 12:38 Christian Brauner
  2022-08-29 12:38 ` [PATCH 1/6] ntfs3: rework xattr handlers and switch to POSIX ACL VFS helpers Christian Brauner
                   ` (5 more replies)
  0 siblings, 6 replies; 25+ messages in thread
From: Christian Brauner @ 2022-08-29 12:38 UTC (permalink / raw)
  To: linux-fsdevel
  Cc: Christian Brauner (Microsoft), Christoph Hellwig, Seth Forshee

From: "Christian Brauner (Microsoft)" <brauner@kernel.org>

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/20220801145520.1532837-1-brauner@kernel.org

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
-- 
2.34.1


^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2022-09-09 14:58 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-29 12:38 [PATCH 0/6] acl: rework idmap handling when setting posix acls Christian Brauner
2022-08-29 12:38 ` [PATCH 1/6] ntfs3: rework xattr handlers and switch to POSIX ACL VFS helpers Christian Brauner
2022-08-29 12:44   ` Christian Brauner
2022-08-30 12:51   ` Seth Forshee
2022-08-29 12:38 ` [PATCH 2/6] acl: return EOPNOTSUPP in posix_acl_fix_xattr_common() Christian Brauner
2022-08-30 12:51   ` Seth Forshee
2022-09-06  4:54   ` Christoph Hellwig
2022-08-29 12:38 ` [PATCH 3/6] acl: add vfs_set_acl_prepare() Christian Brauner
2022-08-30 12:55   ` Seth Forshee
2022-09-06  4:57   ` Christoph Hellwig
2022-09-06  7:45     ` Christian Brauner
2022-09-06  7:53       ` Christoph Hellwig
2022-09-06  8:07         ` Christian Brauner
2022-09-06  8:15           ` Christoph Hellwig
2022-09-06  8:24             ` Christian Brauner
2022-09-06  8:28               ` Christoph Hellwig
2022-09-09  8:03               ` Christian Brauner
2022-09-09 14:58                 ` Christoph Hellwig
2022-08-29 12:38 ` [PATCH 4/6] acl: move idmapping handling into posix_acl_xattr_set() Christian Brauner
2022-08-30 12:56   ` Seth Forshee
2022-08-29 12:38 ` [PATCH 5/6] ovl: use vfs_set_acl_prepare() Christian Brauner
2022-08-29 12:46   ` Christian Brauner
2022-08-30 12:56   ` Seth Forshee
2022-08-29 12:38 ` [PATCH 6/6] xattr: constify value argument in vfs_setxattr() Christian Brauner
2022-08-30 12:57   ` Seth Forshee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).