On Tue, Apr 23, 2024 at 10:52:38AM -0700, Lokesh Gidra wrote: > Commit d7a08838ab74 ("mm: userfaultfd: fix unexpected change to src_folio > when UFFDIO_MOVE fails") moved the src_folio->{mapping, index} changing to > after clearing the page-table and ensuring that it's not pinned. This > avoids failure of swapout+migration and possibly memory corruption. > > However, the commit missed fixing it in the huge-page case. > > Link: https://lkml.kernel.org/r/20240404171726.2302435-1-lokeshgidra@xxxxxxxxxx > Fixes: adef440691ba ("userfaultfd: UFFDIO_MOVE uABI") > Signed-off-by: Lokesh Gidra <lokeshgidra@xxxxxxxxxx> > Acked-by: David Hildenbrand <david@xxxxxxxxxx> > Cc: Andrea Arcangeli <aarcange@xxxxxxxxxx> > Cc: Kalesh Singh <kaleshsingh@xxxxxxxxxx> > Cc: Lokesh Gidra <lokeshgidra@xxxxxxxxxx> > Cc: Nicolas Geoffray <ngeoffray@xxxxxxxxxx> > Cc: Peter Xu <peterx@xxxxxxxxxx> > Cc: Qi Zheng <zhengqi.arch@xxxxxxxxxxxxx> > Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx> > Cc: <stable@xxxxxxxxxxxxxxx> > Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> > (cherry picked from commit c0205eaf3af9f5db14d4b5ee4abacf4a583c3c50) > Signed-off-by: Lokesh Gidra <lokeshgidra@xxxxxxxxxx> Now queued up, thanks. greg k-h