Skip to contentSkip to conversation

MIPS: Fix highmem crash in __update_cache.

PATCH New Lars Persson 1 participant 1 message Apr 15, 2015 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS: Fix highmem crash in __update_cache.

Due to a change in flush_dcache_page, highmem pages may have the dcache dirty flag set. Until there is proper support for highmen in cache.c we must filter out highmem pages to avoid NULL pointer dereferences.

---
 arch/mips/mm/cache.c |    4 ++++
 1 file changed, 4 insertions(+)
arch/mips/mm/cache.c +4 -0
index 77d96db..46136f6 100644
@@ -142,6 +142,10 @@ void __update_cache(struct vm_area_struct *vma, unsigned long address,
 	if (unlikely(!pfn_valid(pfn)))
 		return;
 	page = pfn_to_page(pfn);
+
+	if (PageHighMem(page))
+		return;
+
 	if (page_mapping(page) && Page_dcache_dirty(page)) {
 		addr = (unsigned long) page_address(page);
 		if (exec || pages_do_alias(addr, address & PAGE_MASK))
Signature · 1 line
1.7.10.4