linux-stable/arch/mips/mm
Zi Yan aa5fe31b6b mips: use nth_page() in place of direct struct page manipulation
__flush_dcache_pages() is called during hugetlb migration via
migrate_pages() -> migrate_hugetlbs() -> unmap_and_move_huge_page() ->
move_to_new_folio() -> flush_dcache_folio().  And with hugetlb and without
sparsemem vmemmap, struct page is not guaranteed to be contiguous beyond a
section.  Use nth_page() instead.

Without the fix, a wrong address might be used for data cache page flush.
No bug is reported. The fix comes from code inspection.

Link: https://lkml.kernel.org/r/20230913201248.452081-6-zi.yan@sent.com
Fixes: 15fa3e8e32 ("mips: implement the new page table range API")
Signed-off-by: Zi Yan <ziy@nvidia.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Mike Rapoport (IBM) <rppt@kernel.org>
Cc: Muchun Song <songmuchun@bytedance.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-10-04 10:32:29 -07:00
..
c-octeon.c
c-r3k.c
c-r4k.c mips: implement the new page table range API 2023-08-24 16:20:22 -07:00
cache.c mips: use nth_page() in place of direct struct page manipulation 2023-10-04 10:32:29 -07:00
cerr-sb1.c
cex-gen.S
cex-oct.S
cex-sb1.S
context.c
dma-noncoherent.c
extable.c
fault.c
highmem.c
hugetlbpage.c
init.c mips: implement the new page table range API 2023-08-24 16:20:22 -07:00
ioremap.c
ioremap64.c
maccess.c
Makefile
mmap.c
page-funcs.S mips: replace #include <asm/export.h> with #include <linux/export.h> 2023-08-15 10:22:23 +02:00
page.c
pgtable-32.c mips: implement the new page table range API 2023-08-24 16:20:22 -07:00
pgtable-64.c mips: implement the new page table range API 2023-08-24 16:20:22 -07:00
pgtable.c mips: convert various functions to use ptdescs 2023-08-21 13:37:56 -07:00
physaddr.c
sc-debugfs.c
sc-ip22.c
sc-mips.c
sc-r5k.c
sc-rm7k.c
tlb-funcs.S mips: replace #include <asm/export.h> with #include <linux/export.h> 2023-08-15 10:22:23 +02:00
tlb-r3k.c
tlb-r4k.c
tlbex-fault.S
tlbex.c mips: implement the new page table range API 2023-08-24 16:20:22 -07:00
uasm-micromips.c
uasm-mips.c
uasm.c