Skip to contentSkip to conversation

+ mm-hugetlb-check-for-pte-null-pointer-in-__page_check_address.patch added to -mm tree

PATCH [email protected] 1 participant 1 message Dec 16, 2013

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

Subject: + mm-hugetlb-check-for-pte-null-pointer-in-__page_check_address.patch added to -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Mon, 16 Dec 2013 15:01:50 -0800

The patch titled
Subject: mm/hugetlb: check for pte NULL pointer in __page_check_address()
has been added to the -mm tree. Its filename is
mm-hugetlb-check-for-pte-null-pointer-in-__page_check_address.patch

This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-hugetlb-check-for-pte-null-pointer-in-__page_check_address.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-hugetlb-check-for-pte-null-pointer-in-__page_check_address.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: Jianguo Wu <[email protected]>
Subject: mm/hugetlb: check for pte NULL pointer in __page_check_address()

In __page_check_address(), if address's pud is not present, huge_pte_offset() will return NULL, we should check the return value.

---

 mm/rmap.c |    4 ++++
 1 file changed, 4 insertions(+)
mm/rmap.c renamed from mm/rmap.c~mm-hugetlb-check-for-pte-null-pointer-in-__page_check_address +4 -0
diff -puN mm/rmap.c~mm-hugetlb-check-for-pte-null-pointer-in-__page_check_address mm/rmap.c
@@ -600,7 +600,11 @@ pte_t *__page_check_address(struct page
 	spinlock_t *ptl;
 
 	if (unlikely(PageHuge(page))) {
+		/* when pud is not present, pte will be NULL */
 		pte = huge_pte_offset(mm, address);
+		if (!pte)
+			return NULL;
+
 		ptl = huge_pte_lockptr(page_hstate(page), mm, pte);
 		goto check;
 	}

_

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

mm-memory-failurec-recheck-pagehuge-after-hugetlb-page-migrate-successfully.patch mm-hugetlb-check-for-pte-null-pointer-in-__page_check_address.patch