From: Guo Ren Date: Fri, 25 Dec 2020 06:37:08 +0000 (+0000) Subject: csky: Fixup update_mmu_cache called with user io mapping X-Git-Tag: v5.12-rc1~3^2~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3e455cf5f30f87bc871d5fe891841a2cefb29234;p=thirdparty%2Fkernel%2Flinux.git csky: Fixup update_mmu_cache called with user io mapping The function update_mmu_cache could be called by user-io mapping. There is no space of struct page in mem_map for the pte. Just ignore the user-io mmaping in update_mmu_cache. Signed-off-by: Guo Ren --- diff --git a/arch/csky/abiv2/cacheflush.c b/arch/csky/abiv2/cacheflush.c index 790f1ebfba44b..39c51399dd81d 100644 --- a/arch/csky/abiv2/cacheflush.c +++ b/arch/csky/abiv2/cacheflush.c @@ -12,6 +12,9 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, unsigned long addr; struct page *page; + if (!pfn_valid(pte_pfn(*pte))) + return; + page = pfn_to_page(pte_pfn(*pte)); if (page == ZERO_PAGE(0)) return;