diff options
author | Suren Baghdasaryan <surenb@google.com> | 2025-08-06 15:00:22 -0700 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2025-08-11 23:00:59 -0700 |
commit | aba6faec0103ed8f169be8dce2ead41fcb689446 (patch) | |
tree | 4f2b6863b9aa1dc54c4d326f4e790a93f57e5816 /arch/powerpc/sysdev/timer.c | |
parent | cf1b80dc31a1137b8b4568c138b453bf7453204a (diff) |
userfaultfd: fix a crash in UFFDIO_MOVE when PMD is a migration entry
When UFFDIO_MOVE encounters a migration PMD entry, it proceeds with
obtaining a folio and accessing it even though the entry is swp_entry_t.
Add the missing check and let split_huge_pmd() handle migration entries.
While at it also remove unnecessary folio check.
[surenb@google.com: remove extra folio check, per David]
Link: https://lkml.kernel.org/r/20250807200418.1963585-1-surenb@google.com
Link: https://lkml.kernel.org/r/20250806220022.926763-1-surenb@google.com
Fixes: adef440691ba ("userfaultfd: UFFDIO_MOVE uABI")
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Reported-by: syzbot+b446dbe27035ef6bd6c2@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/68794b5c.a70a0220.693ce.0050.GAE@google.com/
Reviewed-by: Peter Xu <peterx@redhat.com>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Lokesh Gidra <lokeshgidra@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'arch/powerpc/sysdev/timer.c')
0 files changed, 0 insertions, 0 deletions