Commit e275c2b7 authored by Suren Baghdasaryan's avatar Suren Baghdasaryan Committed by Lokesh Gidra
Browse files

UPSTREAM: userfaultfd: avoid huge_zero_page in UFFDIO_MOVE

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: adef4406 ("userfaultfd: UFFDIO_MOVE uABI")
Reported-by: default avatar <syzbot+705209281e36404998f6@syzkaller.appspotmail.com>
Signed-off-by: default avatarSuren Baghdasaryan <surenb@google.com>
Acked-by: default avatarDavid 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: default avatarAndrew Morton <akpm@linux-foundation.org>

(cherry picked from commit 5d4747a6)

Bug: 274911254
Change-Id: I7096b02b3a5b101e049608703ee77179d469a434
Signed-off-by: default avatarLokesh Gidra <lokeshgidra@google.com>
parent 60c5a0e0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment