All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: linux-fsdevel@vger.kernel.org
Cc: "Christian Brauner (Microsoft)" <brauner@kernel.org>,
	Christoph Hellwig <hch@lst.de>,
	Seth Forshee <sforshee@digitalocean.com>
Subject: [PATCH 0/6] acl: rework idmap handling when setting posix acls
Date: Mon, 29 Aug 2022 14:38:39 +0200	[thread overview]
Message-ID: <20220829123843.1146874-1-brauner@kernel.org> (raw)

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


             reply	other threads:[~2022-08-29 12:52 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-29 12:38 Christian Brauner [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220829123843.1146874-1-brauner@kernel.org \
    --to=brauner@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=sforshee@digitalocean.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.