Re: [PATCH 03/10] fs: consistently u se file_has_valid_mmap_hooks() helper

Kees Cook <[email protected]>
Newsgroups gmane.comp.file-systems.ecryptfs.general,gmane.linux.block,gmane.linux.kernel,gmane.comp.freedesktop.xorg.drivers.intel,gmane.comp.video.dri.devel,gmane.linux.file-systems,gmane.linux.kernel.aio.general,gmane.linux.file-systems.union,gmane.linux.kernel.mm,gmane.comp.file-systems.btrfs,gmane.comp.file-systems.ceph.devel,gmane.comp.file-systems.coda.general,gmane.comp.file-systems.ext4,gmane.linux.file-systems.f2fs,gmane.linux.uml.devel,gmane.linux.drivers.mtd,gmane.linux.nfs,gmane.comp.file-systems.nilfs.user,gmane.linux.hardware.karma.devel,gmane.linux.kernel.cifs,gmane.network.samba.internals
Message-ID <[email protected]>

On June 16, 2025 12:33:22 PM PDT, Lorenzo Stoakes <[email protected]> wrote:
>Since commit c84bf6dd2b83 ("mm: introduce new .mmap_prepare() file
>callback"), the f_op->mmap() hook has been deprecated in favour of
>f_op->mmap_prepare().
>
>Additionally, commit bb666b7c2707 ("mm: add mmap_prepare() compatibility
>layer for nested file systems") permits the use of the .mmap_prepare() hook
>even in nested filesystems like overlayfs.
>
>There are a number of places where we check only for f_op->mmap - this is
>incorrect now mmap_prepare exists, so update all of these to use the
>general helper file_has_valid_mmap_hooks().
>
>Most notably, this updates the elf logic to allow for the ability to
>execute binaries on filesystems which have the .mmap_prepare hook, but
>additionally we update nested filesystems.
>
>Signed-off-by: Lorenzo Stoakes <[email protected]>
>---
> fs/backing-file.c     | 2 +-
> fs/binfmt_elf.c       | 4 ++--
> fs/binfmt_elf_fdpic.c | 2 +-

Thanks for the refactoring!

Acked-by: Kees Cook<[email protected]>


-- 
Kees Cook
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.