Linux filesystem development
 help / color / mirror / Atom feed
* [PATCH 0/2] Support overlayfs in the idmapped mount tests
@ 2026-06-15 15:33 Christian Brauner
  2026-06-15 15:33 ` [PATCH 1/2] src/vfs: probe O_TMPFILE support on the base mount in the idmapped tests Christian Brauner
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Christian Brauner @ 2026-06-15 15:33 UTC (permalink / raw)
  To: Miklos Szeredi, Amir Goldstein, Zorro Lang
  Cc: linux-unionfs, linux-fsdevel, fstests,
	Christian Brauner (Amutable)

This change is required to make the series in [1] which makes idmapped
overlayfs mounts work compatible with the idmapped mount test suite.

The vfstest idmapped mount tests behind generic/633, generic/696 and
generic/697 fail on overlayfs for two reasons that are specific to
overlayfs and unrelated to idmapped mount semantics:

  - They create a whiteout device, mknod(S_IFCHR, makedev(0, 0)), as a
    fixture -- it is the only character device an unprivileged caller may
    create, being exempt from the CAP_MKNOD check. overlayfs reserves a
    0:0 character device as its on-disk whiteout marker, so ovl_mknod()
    returns -EPERM and the fixture cannot be created.

  - openat_tmpfile_supported() probes O_TMPFILE on the idmapped mount as
    the test's fsuid, which that mount does not map. On overlayfs the
    backing tmpfile then ends up owned by an unmapped id, overlayfs opens
    it with O_NOATIME, and may_open() returns -EPERM, so the probe
    wrongly concludes O_TMPFILE is unsupported and the tmpfile sub-tests
    are skipped.

Patch 1 fixes the probe: O_TMPFILE support is a property of the
filesystem, not of the idmapped mount or the caller's mapping, so it
probes info->t_dir1_fd (the base mount, which the caller owns) just like
the non-idmapped setgid tests already do. This is a general correctness
fix and a no-op on every other filesystem.

Patch 2 adds an is_overlayfs() helper and skips the whiteout-device
fixtures (and the checks that depend on them) on overlayfs, which
genuinely cannot create them; the makedev(5, 1) "creation must fail"
probes keep running.

With both patches generic/633, generic/696 and generic/697 pass on an
idmapped overlayfs mount with no change on any other filesystem; tested
on overlayfs and tmpfs.

The underlying overlayfs O_NOATIME behaviour that turns an unmapped-fsuid
O_TMPFILE into -EPERM is being addressed separately on the kernel side;
these test changes are independent of it.

Link:
https://patch.msgid.link/20260615-work-idmapped-overlayfs-v1-0-7381632aa402@kernel.org [1]

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
---
Christian Brauner (2):
      src/vfs: probe O_TMPFILE support on the base mount in the idmapped tests
      src/vfs: skip whiteout-device fixtures on overlayfs

 src/vfs/idmapped-mounts.c | 166 ++++++++++++++++++++++++----------------------
 src/vfs/utils.c           |   5 ++
 src/vfs/utils.h           |   1 +
 3 files changed, 93 insertions(+), 79 deletions(-)
---
base-commit: ffc8bad17e5b2f56e48dbac43f7c5ae8ac368fe5
change-id: 20260615-overlay-idmapped-vfstest-b262d3084eea


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

end of thread, other threads:[~2026-07-10  5:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-15 15:33 [PATCH 0/2] Support overlayfs in the idmapped mount tests Christian Brauner
2026-06-15 15:33 ` [PATCH 1/2] src/vfs: probe O_TMPFILE support on the base mount in the idmapped tests Christian Brauner
2026-06-15 17:53   ` Amir Goldstein
2026-07-10  5:34   ` Christoph Hellwig
2026-06-15 15:33 ` [PATCH 2/2] src/vfs: skip whiteout-device fixtures on overlayfs Christian Brauner
2026-06-15 18:03   ` Amir Goldstein
2026-07-10  5:34     ` Christoph Hellwig
2026-07-10  5:33 ` [PATCH 0/2] Support overlayfs in the idmapped mount tests Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox