On June 16, 2025 12:33:22 PM PDT, Lorenzo Stoakes <lorenzo.stoa...@oracle.com> 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 <lorenzo.stoa...@oracle.com> >--- > fs/backing-file.c | 2 +- > fs/binfmt_elf.c | 4 ++-- > fs/binfmt_elf_fdpic.c | 2 +- Thanks for the refactoring! Acked-by: Kees Cook<k...@kernel.org> -- Kees Cook
- [PATCH 00/10] convert the majority of file systems to m... Lorenzo Stoakes
- [PATCH 02/10] mm/nommu: use file_has_valid_mmap_ho... Lorenzo Stoakes
- [PATCH 04/10] fs/dax: make it possible to check de... Lorenzo Stoakes
- Re: [PATCH 04/10] fs/dax: make it possible to ... Matthew Wilcox
- Re: [PATCH 04/10] fs/dax: make it possible... Christian Brauner
- [PATCH 07/10] mm/filemap: introduce generic_file_*... Lorenzo Stoakes
- [PATCH 03/10] fs: consistently use file_has_valid_... Lorenzo Stoakes
- Re: [PATCH 03/10] fs: consistently use file_ha... Kees Cook
- Re: [PATCH 03/10] fs: consistently use file_ha... Christoph Hellwig
- Re: [PATCH 03/10] fs: consistently use fil... Lorenzo Stoakes
- Re: [PATCH 03/10] fs: consistently use... Christoph Hellwig
- Re: [PATCH 03/10] fs: consistently use... Jan Kara
- Re: [PATCH 03/10] fs: consistentl... Christian Brauner
- [PATCH 10/10] fs: replace mmap hook with .mmap_pre... Lorenzo Stoakes
- Re: [PATCH 10/10] fs: replace mmap hook with .... Damien Le Moal
- Re: [PATCH 10/10] fs: replace mmap hook with ... Viacheslav Dubeyko
- Re: [PATCH 10/10] fs: replace mmap hook with .... Jan Kara
- Re: [PATCH 10/10] fs: replace mmap hook wi... Christian Brauner