From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,sfr@canb.auug.org.au,peterx@redhat.com,david@redhat.com,aarcange@redhat.com,surenb@google.com,akpm@linux-foundation.org
Subject: [merged mm-hotfixes-stable] userfaultfd-avoid-huge_zero_page-in-uffdio_move.patch removed from -mm tree
Date: Fri, 12 Jan 2024 15:21:47 -0800 [thread overview]
Message-ID: <20240112232147.BC28CC43390@smtp.kernel.org> (raw)
The quilt patch titled
Subject: userfaultfd: avoid huge_zero_page in UFFDIO_MOVE
has been removed from the -mm tree. Its filename was
userfaultfd-avoid-huge_zero_page-in-uffdio_move.patch
This patch was dropped because it was merged into the mm-hotfixes-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Suren Baghdasaryan <surenb@google.com>
Subject: userfaultfd: avoid huge_zero_page in UFFDIO_MOVE
Date: Thu, 11 Jan 2024 17:39:35 -0800
While testing UFFDIO_MOVE ioctl, syzbot triggered VM_BUG_ON_PAGE caused by
a call to PageAnonExclusive() with a huge_zero_page as a parameter.
UFFDIO_MOVE does not yet handle zeropages and returns EBUSY when one is
encountered. Add an early huge_zero_page check in the PMD move path to
avoid this situation.
Link: https://lkml.kernel.org/r/20240112013935.1474648-1-surenb@google.com
Fixes: adef440691ba ("userfaultfd: UFFDIO_MOVE uABI")
Reported-by: syzbot+705209281e36404998f6@syzkaller.appspotmail.com
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/userfaultfd.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/mm/userfaultfd.c~userfaultfd-avoid-huge_zero_page-in-uffdio_move
+++ a/mm/userfaultfd.c
@@ -1393,6 +1393,12 @@ ssize_t move_pages(struct userfaultfd_ct
err = -ENOENT;
break;
}
+ /* Avoid moving zeropages for now */
+ if (is_huge_zero_pmd(*src_pmd)) {
+ spin_unlock(ptl);
+ err = -EBUSY;
+ break;
+ }
/* Check if we can move the pmd without splitting it. */
if (move_splits_huge_pmd(dst_addr, src_addr, src_start + len) ||
_
Patches currently in -mm which might be from surenb@google.com are
reply other threads:[~2024-01-12 23:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20240112232147.BC28CC43390@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=aarcange@redhat.com \
--cc=david@redhat.com \
--cc=mm-commits@vger.kernel.org \
--cc=peterx@redhat.com \
--cc=sfr@canb.auug.org.au \
--cc=surenb@google.com \
/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.