From: Andrew Morton <akpm@linux-foundation.org>
To: David CARLIER <devnexen@gmail.com>
Cc: Peter Xu <peterx@redhat.com>, Mike Rapoport <rppt@kernel.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] mm/userfaultfd: detect VMA replacement after copy retry in mfill_copy_folio_retry()
Date: Mon, 30 Mar 2026 16:42:35 -0700 [thread overview]
Message-ID: <20260330164235.1d1c8968993d5409f1922ce4@linux-foundation.org> (raw)
In-Reply-To: <CA+XhMqyZaOpSqCYpH-13eusaNvZDXmtprAy-93EsB+vFOpnqEQ@mail.gmail.com>
On Mon, 30 Mar 2026 22:32:58 +0100 David CARLIER <devnexen@gmail.com> wrote:
> The userspace-visible effect is a kernel NULL pointer dereference. When
> a shared shmem VMA gets replaced by an anonymous VMA during the
> retry
> window, the stale ops->filemap_add() ends up calling
> shmem_mfill_filemap_add() which dereferences vma->vm_file via
> file_inode(). Since vm_file is NULL for anonymous mappings, this is a
> straight kernel oops.
>
> The window is particularly wide when copy_from_user() blocks on slow
> backing stores (FUSE, NFS) as it runs with page faults enabled.
>
> The Fixes target would be 56a3706fd7f9 ("shmem, userfaultfd:
> implement
> shmem uffd operations using vm_uffd_ops") but that's mm-unstable only,
> so no Cc: stable for now.
Ah, OK, thanks. I'll add a note to "shmem, userfaultfd: implement
shmem uffd operations using vm_uffd_ops" for now, let's see what Mike
thinks.
next prev parent reply other threads:[~2026-03-30 23:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-30 20:29 David Carlier
2026-03-30 20:40 ` Andrew Morton
2026-03-30 21:27 ` David CARLIER
2026-03-30 21:32 ` David CARLIER
2026-03-30 23:42 ` Andrew Morton [this message]
2026-03-30 20:51 ` Peter Xu
2026-03-31 11:56 ` Mike Rapoport
2026-03-31 12:07 ` David CARLIER
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=20260330164235.1d1c8968993d5409f1922ce4@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=devnexen@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=peterx@redhat.com \
--cc=rppt@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox