linux-unionfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/4] ovl: add override_creds mount option
@ 2025-02-19 10:01 Christian Brauner
  2025-02-19 10:01 ` [PATCH v3 1/4] ovl: allow to specify override credentials Christian Brauner
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Christian Brauner @ 2025-02-19 10:01 UTC (permalink / raw)
  To: Miklos Szeredi, Amir Goldstein, Seth Forshee
  Cc: Gopal Kakivaya, linux-unionfs, linux-fsdevel, Christian Brauner

Hey,

Currently overlayfs uses the mounter's credentials for it's
override_creds() calls. That provides a consistent permission model.

This patches allows a caller to instruct overlayfs to use its
credentials instead. The caller must be located in the same user
namespace hierarchy as the user namespace the overlayfs instance will be
mounted in. This provides a consistent and simple security model.

With this it is possible to e.g., mount an overlayfs instance where the
mounter must have CAP_SYS_ADMIN but the credentials used for
override_creds() have dropped CAP_SYS_ADMIN. It also allows the usage of
custom fs{g,u}id different from the callers and other tweaks.

Thanks!
Christian

Signed-off-by: Christian Brauner <brauner@kernel.org>
---
Changes in v3:
- Extended selftests.
- Allowed all user descendant namespaces.
- Link to v2: https://lore.kernel.org/r/20250217-work-overlayfs-v2-0-41dfe7718963@kernel.org

Changes in v2:
- Added new section to overlayfs Documentation.
- Link to v1: https://lore.kernel.org/r/20250214-work-overlayfs-v1-0-465d1867d3d4@kernel.org

---
Christian Brauner (4):
      ovl: allow to specify override credentials
      selftests/ovl: add first selftest for "override_creds"
      selftests/ovl: add second selftest for "override_creds"
      selftests/ovl: add third selftest for "override_creds"

 Documentation/filesystems/overlayfs.rst            |  24 +-
 fs/overlayfs/params.c                              |  25 +
 fs/overlayfs/super.c                               |  16 +-
 .../selftests/filesystems/overlayfs/Makefile       |  11 +-
 .../filesystems/overlayfs/set_layers_via_fds.c     | 312 ++++++++++++-
 tools/testing/selftests/filesystems/utils.c        | 501 +++++++++++++++++++++
 tools/testing/selftests/filesystems/utils.h        |  45 ++
 7 files changed, 924 insertions(+), 10 deletions(-)
---
base-commit: 2014c95afecee3e76ca4a56956a936e23283f05b
change-id: 20250214-work-overlayfs-dfcfc4cd7ebd


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

end of thread, other threads:[~2025-02-19 13:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-19 10:01 [PATCH v3 0/4] ovl: add override_creds mount option Christian Brauner
2025-02-19 10:01 ` [PATCH v3 1/4] ovl: allow to specify override credentials Christian Brauner
2025-02-19 11:44   ` Amir Goldstein
2025-02-19 13:27     ` Christian Brauner
2025-02-19 10:01 ` [PATCH v3 2/4] selftests/ovl: add first selftest for "override_creds" Christian Brauner
2025-02-19 10:01 ` [PATCH v3 3/4] selftests/ovl: add second " Christian Brauner
2025-02-19 12:36   ` Amir Goldstein
2025-02-19 13:25     ` Christian Brauner
2025-02-19 10:01 ` [PATCH v3 4/4] selftests/ovl: add third " Christian Brauner
2025-02-19 11:58   ` Amir Goldstein

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).