[PATCH 00/14] mm: convert further simple mmap hooks to mmap_prepare

Lorenzo Stoakes (ARM) posted 14 patches 2 weeks, 4 days ago
There is a newer version of this series
arch/powerpc/kvm/book3s_64_vio.c        |  6 +++---
arch/x86/kernel/cpu/sgx/virt.c          | 15 ++++++++-------
drivers/hv/mshv_vtl_main.c              | 14 +++++++-------
drivers/misc/bcm-vk/bcm_vk_dev.c        | 20 ++++++++++----------
drivers/ptp/ptp_vmclock.c               | 19 +++++++++----------
drivers/soc/aspeed/aspeed-lpc-ctrl.c    | 20 +++++++++-----------
drivers/soc/aspeed/aspeed-p2a-ctrl.c    | 22 ++++++++--------------
drivers/soc/qcom/rmtfs_mem.c            | 22 ++++++++++------------
drivers/tee/tee_shm.c                   | 14 +++++++-------
drivers/vdpa/vdpa_user/iova_domain.c    | 12 ++++++------
drivers/vhost/vdpa.c                    | 23 ++++++++++++-----------
drivers/xen/privcmd.c                   | 11 +++++------
drivers/xen/xenbus/xenbus_dev_backend.c | 14 ++++++--------
drivers/xen/xenfs/xenstored.c           | 14 ++++++--------
fs/udf/file.c                           |  8 ++++----
security/selinux/selinuxfs.c            | 24 +++++++++++-------------
16 files changed, 121 insertions(+), 137 deletions(-)
[PATCH 00/14] mm: convert further simple mmap hooks to mmap_prepare
Posted by Lorenzo Stoakes (ARM) 2 weeks, 4 days ago
Continue the conversion of users of the deprecated f_op->mmap callback to
f_op->mmap_prepare. Keep things gentle this cycle by targeting simple
cases.

No functional change intended.

Build tested on x86-64 (allmodconfig, each patch individually), i386,
arm64 and ppc64le.

<<>>

David, Andrew - I wonder whether one of you guys could take this series
through your tree? Since it's kernel-wide it seems sensible to take it
through an mm tree.

Thanks!

Signed-off-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
---
Lorenzo Stoakes (ARM) (14):
      xen/privcmd: convert mmap hook to mmap_prepare
      KVM: PPC: Book3S: convert spapr TCE mmap hook to mmap_prepare
      mshv_vtl: convert mmap hooks to mmap_prepare
      vduse: convert IOVA domain mmap hook to mmap_prepare
      x86/sgx: convert vepc mmap hook to mmap_prepare
      udf: convert mmap hook to mmap_prepare
      selinuxfs: convert mmap hooks to mmap_prepare
      xen: convert xenstore interface mmap hooks to mmap_prepare
      soc: aspeed: convert LPC and P2A control mmap hooks to mmap_prepare
      soc: qcom: rmtfs_mem: convert mmap hook to mmap_prepare
      tee: convert shm mmap hook to mmap_prepare
      misc: bcm-vk: convert mmap hook to mmap_prepare
      ptp: vmclock: convert mmap hook to mmap_prepare
      vhost-vdpa: convert mmap hook to mmap_prepare

 arch/powerpc/kvm/book3s_64_vio.c        |  6 +++---
 arch/x86/kernel/cpu/sgx/virt.c          | 15 ++++++++-------
 drivers/hv/mshv_vtl_main.c              | 14 +++++++-------
 drivers/misc/bcm-vk/bcm_vk_dev.c        | 20 ++++++++++----------
 drivers/ptp/ptp_vmclock.c               | 19 +++++++++----------
 drivers/soc/aspeed/aspeed-lpc-ctrl.c    | 20 +++++++++-----------
 drivers/soc/aspeed/aspeed-p2a-ctrl.c    | 22 ++++++++--------------
 drivers/soc/qcom/rmtfs_mem.c            | 22 ++++++++++------------
 drivers/tee/tee_shm.c                   | 14 +++++++-------
 drivers/vdpa/vdpa_user/iova_domain.c    | 12 ++++++------
 drivers/vhost/vdpa.c                    | 23 ++++++++++++-----------
 drivers/xen/privcmd.c                   | 11 +++++------
 drivers/xen/xenbus/xenbus_dev_backend.c | 14 ++++++--------
 drivers/xen/xenfs/xenstored.c           | 14 ++++++--------
 fs/udf/file.c                           |  8 ++++----
 security/selinux/selinuxfs.c            | 24 +++++++++++-------------
 16 files changed, 121 insertions(+), 137 deletions(-)
---
base-commit: b61fa14ce6bcbba2cb9a96feea31b760226d6b43
change-id: 20261101-late-2026-mmap_prepare-02c87d23101e

Cheers,
-- 
Lorenzo Stoakes (ARM) <ljs@kernel.org>
Re: [PATCH 00/14] mm: convert further simple mmap hooks to mmap_prepare
Posted by Paul Moore 2 weeks, 3 days ago
On Thu, Nov 5, 2026 at 4:06 PM Lorenzo Stoakes (ARM) <ljs@kernel.org> wrote:
>
> Continue the conversion of users of the deprecated f_op->mmap callback to
> f_op->mmap_prepare. Keep things gentle this cycle by targeting simple
> cases.
>
> No functional change intended.
>
> Build tested on x86-64 (allmodconfig, each patch individually), i386,
> arm64 and ppc64le.
>
> <<>>
>
> David, Andrew - I wonder whether one of you guys could take this series
> through your tree? Since it's kernel-wide it seems sensible to take it
> through an mm tree.

Granted I've only properly looked at the SELinux patch (7/14), the
rest I've just skimmed through, but these are all independent patches,
right?  Is there any reason why individual subsystem maintainers
shouldn't just pick up their associated patch?  Yes, perhaps chasing
down individual maintainers is a bit more work, but isn't that the way
this should work?

> Lorenzo Stoakes (ARM) (14):
>       xen/privcmd: convert mmap hook to mmap_prepare
>       KVM: PPC: Book3S: convert spapr TCE mmap hook to mmap_prepare
>       mshv_vtl: convert mmap hooks to mmap_prepare
>       vduse: convert IOVA domain mmap hook to mmap_prepare
>       x86/sgx: convert vepc mmap hook to mmap_prepare
>       udf: convert mmap hook to mmap_prepare
>       selinuxfs: convert mmap hooks to mmap_prepare
>       xen: convert xenstore interface mmap hooks to mmap_prepare
>       soc: aspeed: convert LPC and P2A control mmap hooks to mmap_prepare
>       soc: qcom: rmtfs_mem: convert mmap hook to mmap_prepare
>       tee: convert shm mmap hook to mmap_prepare
>       misc: bcm-vk: convert mmap hook to mmap_prepare
>       ptp: vmclock: convert mmap hook to mmap_prepare
>       vhost-vdpa: convert mmap hook to mmap_prepare
>
>  arch/powerpc/kvm/book3s_64_vio.c        |  6 +++---
>  arch/x86/kernel/cpu/sgx/virt.c          | 15 ++++++++-------
>  drivers/hv/mshv_vtl_main.c              | 14 +++++++-------
>  drivers/misc/bcm-vk/bcm_vk_dev.c        | 20 ++++++++++----------
>  drivers/ptp/ptp_vmclock.c               | 19 +++++++++----------
>  drivers/soc/aspeed/aspeed-lpc-ctrl.c    | 20 +++++++++-----------
>  drivers/soc/aspeed/aspeed-p2a-ctrl.c    | 22 ++++++++--------------
>  drivers/soc/qcom/rmtfs_mem.c            | 22 ++++++++++------------
>  drivers/tee/tee_shm.c                   | 14 +++++++-------
>  drivers/vdpa/vdpa_user/iova_domain.c    | 12 ++++++------
>  drivers/vhost/vdpa.c                    | 23 ++++++++++++-----------
>  drivers/xen/privcmd.c                   | 11 +++++------
>  drivers/xen/xenbus/xenbus_dev_backend.c | 14 ++++++--------
>  drivers/xen/xenfs/xenstored.c           | 14 ++++++--------
>  fs/udf/file.c                           |  8 ++++----
>  security/selinux/selinuxfs.c            | 24 +++++++++++-------------
>  16 files changed, 121 insertions(+), 137 deletions(-)

-- 
paul-moore.com
Re: [PATCH 00/14] mm: convert further simple mmap hooks to mmap_prepare
Posted by Lorenzo Stoakes (ARM) 2 weeks, 3 days ago
On Thu, Nov 05, 2026 at 06:12:09PM -0500, Paul Moore wrote:
> On Thu, Nov 5, 2026 at 4:06 PM Lorenzo Stoakes (ARM) <ljs@kernel.org> wrote:
> >
> > Continue the conversion of users of the deprecated f_op->mmap callback to
> > f_op->mmap_prepare. Keep things gentle this cycle by targeting simple
> > cases.
> >
> > No functional change intended.
> >
> > Build tested on x86-64 (allmodconfig, each patch individually), i386,
> > arm64 and ppc64le.
> >
> > <<>>
> >
> > David, Andrew - I wonder whether one of you guys could take this series
> > through your tree? Since it's kernel-wide it seems sensible to take it
> > through an mm tree.
>
> Granted I've only properly looked at the SELinux patch (7/14), the
> rest I've just skimmed through, but these are all independent patches,
> right?  Is there any reason why individual subsystem maintainers
> shouldn't just pick up their associated patch?  Yes, perhaps chasing
> down individual maintainers is a bit more work, but isn't that the way
> this should work?

I've no objection to people taking patches independently, the concern is people
lagging on that and holding up a key conversion which is entirely mechanical, +
generally tree-wide stuff like this has been via the mm tree.

The mmap_prepare stuff is actually important for security (pertinent given
current AI fix storm) as it's by design super locked down vs. mmap which has
caused several genuine issues including a nasty 0-day.

So am keen to keep that rolling!

In this case each patch is mechanical and simple, so little surface area for
issues.

--
Cheers, Lorenzo
Re: [PATCH 00/14] mm: convert further simple mmap hooks to mmap_prepare
Posted by Jarkko Sakkinen 2 weeks, 3 days ago
On Fri, Nov 06, 2026 at 10:18:06AM +0000, Lorenzo Stoakes (ARM) wrote:
> > Granted I've only properly looked at the SELinux patch (7/14), the
> > rest I've just skimmed through, but these are all independent patches,
> > right?  Is there any reason why individual subsystem maintainers
> > shouldn't just pick up their associated patch?  Yes, perhaps chasing
> > down individual maintainers is a bit more work, but isn't that the way
> > this should work?
> 
> I've no objection to people taking patches independently, the concern is people
> lagging on that and holding up a key conversion which is entirely mechanical, +
> generally tree-wide stuff like this has been via the mm tree.

This is probably the best way forward, as for a subsystem this is just a
different API for doing the exact same thing (and that way "idempotent").

And looking at the intersection points overall, the changes are neither
likely to cause any major merge conflicts...

Br, Jarkko