Skip to contentSkip to conversation

+ pagewalk-remove-argument-hmask-from-hugetlb_entry-fix.patch added to -mm tree

PATCH [email protected] 1 participant 1 message Feb 18, 2014

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

Subject: + pagewalk-remove-argument-hmask-from-hugetlb_entry-fix.patch added to -mm tree
To: [email protected],[email protected]
From: [email protected]
Date: Tue, 18 Feb 2014 12:44:10 -0800

The patch titled
Subject: fs/proc/task_mmu.c: assume non-NULL vma in pagemap_hugetlb()
has been added to the -mm tree. Its filename is
pagewalk-remove-argument-hmask-from-hugetlb_entry-fix.patch

This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/pagewalk-remove-argument-hmask-from-hugetlb_entry-fix.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/pagewalk-remove-argument-hmask-from-hugetlb_entry-fix.patch

Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated there every 3-4 working days

------------------------------------------------------
From: Naoya Horiguchi <[email protected]>
Subject: fs/proc/task_mmu.c: assume non-NULL vma in pagemap_hugetlb()

Fengguang reported smatch error about potential NULL pointer access.

In updated page table walker, we never run ->hugetlb_entry() callback on the address without vma. This is because __walk_page_range() checks it in advance. So we can assume non-NULL vma in pagemap_hugetlb().

---

 fs/proc/task_mmu.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/proc/task_mmu.c renamed from fs/proc/task_mmu.c~pagewalk-remove-argument-hmask-from-hugetlb_entry-fix +2 -2
diff -puN fs/proc/task_mmu.c~pagewalk-remove-argument-hmask-from-hugetlb_entry-fix fs/proc/task_mmu.c
@@ -1032,9 +1032,9 @@ static int pagemap_hugetlb(pte_t *pte, u
 	pagemap_entry_t pme;
 	unsigned long hmask;
 
-	WARN_ON_ONCE(!vma);
+	BUG_ON(!vma);
 
-	if (vma && (vma->vm_flags & VM_SOFTDIRTY))
+	if (vma->vm_flags & VM_SOFTDIRTY)
 		flags2 = __PM_SOFT_DIRTY;
 	else
 		flags2 = 0;

_

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

mm-hwpoison-release-page-on-pagehwpoison-in-__do_fault.patch mm-hugetlb-unify-region-structure-handling.patch mm-hugetlb-improve-cleanup-resv_map-parameters.patch mm-hugetlb-fix-race-in-region-tracking.patch mm-hugetlb-remove-resv_map_put.patch mm-hugetlb-use-vma_resv_map-map-types.patch mm-hugetlb-improve-page-fault-scalability.patch mm-hugetlb-improve-page-fault-scalability-fix.patch pagewalk-update-page-table-walker-core.patch pagewalk-add-walk_page_vma.patch smaps-redefine-callback-functions-for-page-table-walker.patch clear_refs-redefine-callback-functions-for-page-table-walker.patch pagemap-redefine-callback-functions-for-page-table-walker.patch numa_maps-redefine-callback-functions-for-page-table-walker.patch memcg-redefine-callback-functions-for-page-table-walker.patch madvise-redefine-callback-functions-for-page-table-walker.patch arch-powerpc-mm-subpage-protc-use-walk_page_vma-instead-of-walk_page_range.patch pagewalk-remove-argument-hmask-from-hugetlb_entry.patch pagewalk-remove-argument-hmask-from-hugetlb_entry-fix.patch pagewalk-remove-argument-hmask-from-hugetlb_entry-fix-fix.patch mempolicy-apply-page-table-walker-on-queue_pages_range.patch mm-rename-__do_fault-do_fault.patch mm-do_fault-extract-to-call-vm_ops-do_fault-to-separate-function.patch mm-introduce-do_read_fault.patch
mm-introduce-do_cow_fault.patch mm-introduce-do_shared_fault-and-drop-do_fault.patch mm-consolidate-code-to-call-vm_ops-page_mkwrite.patch mm-consolidate-code-to-setup-pte.patch