Skip to contentSkip to conversation

mm-implement-map_pages-for-page-cache-fix.patch removed from -mm tree

folded-merged [email protected] 1 participant 1 message Apr 7, 2014

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

Subject: [folded-merged] mm-implement-map_pages-for-page-cache-fix.patch removed from -mm tree
To: [email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Mon, 07 Apr 2014 15:03:34 -0700

The patch titled
Subject: mm: filemap_map_pages() avoid dereference NULL/exception slots
has been removed from the -mm tree. Its filename was
mm-implement-map_pages-for-page-cache-fix.patch

This patch was dropped because it was folded into mm-implement-map_pages-for-page-cache.patch

------------------------------------------------------
From: "Kirill A. Shutemov" <[email protected]>
Subject: mm: filemap_map_pages() avoid dereference NULL/exception slots

radix_tree_deref_slot() can return NULL: add missed check.

Do no dereference 'page': we can get there as result of radix_tree_exception(page) check.

---

 mm/filemap.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
mm/filemap.c renamed from mm/filemap.c~mm-implement-map_pages-for-page-cache-fix +3 -1
diff -puN mm/filemap.c~mm-implement-map_pages-for-page-cache-fix mm/filemap.c
@@ -2083,6 +2083,8 @@ void filemap_map_pages(struct vm_area_st
 			break;
 repeat:
 		page = radix_tree_deref_slot(slot);
+		if (unlikely(!page))
+			goto next;
 		if (radix_tree_exception(page)) {
 			if (radix_tree_deref_retry(page))
 				break;
@@ -2128,7 +2130,7 @@ unlock:
 skip:
 		page_cache_release(page);
 next:
-		if (page->index == vmf->max_pgoff)
+		if (iter.index == vmf->max_pgoff)
 			break;
 	}
 	rcu_read_unlock();

_

Patches currently in -mm which might be from [email protected] are

origin.patch mm-hugetlbc-add-null-check-of-return-value-of-huge_pte_offset.patch mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch mm-thp-add-vm_init_def_mask-and-prctl_thp_disable.patch exec-kill-the-unnecessary-mm-def_flags-setting-in-load_elf_binary.patch mm-disable-split-page-table-lock-for-mmu.patch drivers-lguest-page_tablesc-rename-do_set_pte.patch mm-introduce-vm_ops-map_pages.patch mm-implement-map_pages-for-page-cache.patch mm-cleanup-size-checks-in-filemap_fault-and-filemap_map_pages.patch mm-add-debugfs-tunable-for-fault_around_order.patch mm-add-debugfs-tunable-for-fault_around_order-checkpatch-fixes.patch mm-use-const-char-insted-of-char-for-reason-in-dump_page.patch