All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lorenzo Stoakes <ljs@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
	 Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
	David Hildenbrand <david@kernel.org>,
	 "Liam R . Howlett" <Liam.Howlett@oracle.com>,
	Vlastimil Babka <vbabka@kernel.org>,
	 Mike Rapoport <rppt@kernel.org>,
	Suren Baghdasaryan <surenb@google.com>,
	 Michal Hocko <mhocko@suse.com>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	 linux-mm@kvack.org,
	Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Subject: Re: [PATCH mm-hotfixes] mm/vma: remove __vma_check_mmap_hook()
Date: Wed, 15 Apr 2026 07:34:58 +0100	[thread overview]
Message-ID: <ad8xfnn05PtejbMP@lucifer> (raw)
In-Reply-To: <20260413221724.c939e483e83304fb40e3d6da@linux-foundation.org>

On Mon, Apr 13, 2026 at 10:17:24PM -0700, Andrew Morton wrote:
> On Mon, 13 Apr 2026 11:57:13 +0100 Lorenzo Stoakes <ljs@kernel.org> wrote:
>
> > Commit c50ca15dd496 ("mm: add vm_ops->mapped hook") introduced
> > __vma_check_mmap_hook() in order to assert that a driver doesn't
> > incorrectly implement both an f_op->mmap() and a vm_ops->mapped hook, the
> > latter of which would not ultimately get invoked.
> >
> > However, this did not correctly account for stacked drivers (or drivers
> > that otherwise use the compatibility layer) which might recursively call
> > an mmap_prepare hook via the compatibility layer.
> >
> > Thus the nested mmap_prepare() invocation might result in a VMA which has
> > vm_ops->mapped set with an overlaying mmap() hook, causing the
> > __vma_check_mmap_hook() to fail in vfs_mmap(), wrongly failing the
> > operation.
> >
> > This patch resolves this by simply removing the check, as we can't be
> > certain that an mmap() hook doesn't at some point invoke the compatibility
> > layer, and it's not worth trying to track it.
>
> Cool, thanks.
>
> > Fixes: c50ca15dd496 ("mm: add vm_ops->mapped hook")
>
> That's presently in flight mm.git->Linus, So I'll include this fix in
> next week's second batch of MM updates into Linus.

Ack thanks!

>
>
> > c50ca15dd496 is in mm-stable, so thought best to do as fix-patch? Will
> > leave a small bisection hazard (unfortunately) so putting this as close as
> > possible to the patch it fixes would be ideal.
>
> Yep, I did that.

Thanks!

>
>

Cheers, Lorenzo

      reply	other threads:[~2026-04-15  6:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-13 10:57 [PATCH mm-hotfixes] mm/vma: remove __vma_check_mmap_hook() Lorenzo Stoakes
2026-04-13 11:16 ` Vlastimil Babka (SUSE)
2026-04-13 12:28 ` Shinichiro Kawasaki
2026-04-13 14:02   ` Lorenzo Stoakes
2026-04-14  5:17 ` Andrew Morton
2026-04-15  6:34   ` Lorenzo Stoakes [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ad8xfnn05PtejbMP@lucifer \
    --to=ljs@kernel.org \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=brauner@kernel.org \
    --cc=david@kernel.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=rppt@kernel.org \
    --cc=shinichiro.kawasaki@wdc.com \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.