Skip to content

Handle notifications on overlayfs fake path files

Amir Goldstein linux-fsdevel linux-unionfs 4 versions – Applied

Status from this message: Applied to the vfs.backing.file branch of the vfs/vfs.git tree.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest5 patches 6 repliesApplied
  2. v42 patches 5 repliesSuperseded
  3. v32 patches 7 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v23 patches16 repliesSuperseded

Changes in v5 from the cover letter

- ACK from Jan for fsnotify patch
- Do not use backing_file for cachefiles (brauner)
- Consistent naming scheme *_*file_open() (brauner)
- Split patches and better documentation (hch)

Patches in v5 Applied

#Subject and filesSizeRepliesApplied
1/5fs: rename {vfs,kernel}_tmpfile_open()fs/cachefiles/namei.c fs/namei.c fs/overlayfs/overlayfs.h +1 more+23 -191 reply
2/5fs: use a helper for opening kernel internal filesfs/cachefiles/namei.c fs/open.c include/linux/fs.h+35 -21 reply
3/5fs: move kmem_cache_zalloc() into alloc_empty_file*() helpersfs/file_table.c+26 -151 reply
4/5fs: use backing_file container for internal files with "fake" f_pathfs/file_table.c fs/internal.h fs/open.c +2 more+105 -232 replies
5/5ovl: enable fsnotify events on underlying real filesfs/overlayfs/file.c include/linux/fsnotify.h+4 -30 replies

Reviews trailers per patch

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

PatchJan KaraChristoph Hellwig
1/5R-b
2/5R-b
3/5R-b
4/5
5/5A-b

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

Read the v5 thread

Cover letter [PATCH v5 0/5] Handle notifications on overlayfs fake path files

Christian,

A little while ago, Jan and I realized that an unprivileged overlayfs mount could be used to avert fanotify permission events that were requested for an inode or sb on the underlying fs.

The [v1] patch set was an attempt to implement Miklos' suggestion (opt-in to query the fake path) which turned out to affet the vfs in many places, so Miklos and I agreed on a solution that will be less intrusive for vfs (opt-in to query the real path).

The [v2] patch set took the less intrusive approach to vfs, but it also tried a different approach of extending the d_real() interface, which Miklos did not like.

The [v3] patch goes back to the less intrusive approach to vfs without complicating d_real() interface, that Miklso and I agreed on during the [v1] patch set review, so hopefully everyone can be happy with it.

This v5 patch set addresses review comments from yourself and from Christoph on [v3] and [v4].

Since the patches are 95% vfs, I think it is better if they are merged through the vfs tree.

I am still hoping to solicit an ACK from Miklos on the ovl change in the last patch.

Thanks,
Amir.

Changes since [v4]:
- ACK from Jan for fsnotify patch
- Do not use backing_file for cachefiles (brauner)
- Consistent naming scheme *_*file_open() (brauner)
- Split patches and better documentation (hch)

Changes since [v3]:
- Rename struct file_fake to backing_file
- Rename helpers to open_backing_file(), backing_file_real_path()
- Rename FMODE_FAKE_PATH to FMODE_BACKING
- Separate flag from FMODE_NOACCOUNT
- inline the fast-path branch of f_real_path()

Changes since [v2]:
- Restore the file_fake container (Miklos)
- Re-arrange the v1 helpers (Christian)

Changes since [v1]:
- Drop the file_fake container
- Leave f_path fake and special case only fsnotify

[v4] https://lore.kernel.org/linux-unionfs/[email protected]/
[v3] https://lore.kernel.org/linux-unionfs/[email protected]/
[v2] https://lore.kernel.org/linux-unionfs/[email protected]/
[v1] https://lore.kernel.org/linux-unionfs/[email protected]/

Amir Goldstein (5):
fs: rename {vfs,kernel}_tmpfile_open()
fs: use a helper for opening kernel internal files
fs: move kmem_cache_zalloc() into alloc_empty_file*() helpers
fs: use backing_file container for internal files with "fake" f_path
ovl: enable fsnotify events on underlying real files

 fs/cachefiles/namei.c    | 10 ++---
 fs/file_table.c          | 91 ++++++++++++++++++++++++++++++++--------
 fs/internal.h            |  5 ++-
 fs/namei.c               | 24 ++++++-----
 fs/open.c                | 75 ++++++++++++++++++++++++++++-----
 fs/overlayfs/file.c      |  8 ++--
 fs/overlayfs/overlayfs.h |  5 ++-
 include/linux/fs.h       | 32 ++++++++++----
 include/linux/fsnotify.h |  3 +-
 9 files changed, 192 insertions(+), 61 deletions(-)
Signature · 1 line
2.34.1