From: Naoya Horiguchi Date: Fri, 6 Jun 2014 14:00:01 +0000 (-0400) Subject: mm: add !pte_present() check on existing hugetlb_entry callbacks X-Git-Tag: omap-for-v3.16/fixes-against-rc1~97 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d4c54919ed86302094c0ca7d48a8cbd4ee753e92;p=pandora-kernel.git mm: add !pte_present() check on existing hugetlb_entry callbacks The age table walker doesn't check non-present hugetlb entry in common path, so hugetlb_entry() callbacks must check it. The reason for this behavior is that some callers want to handle it in its own way. [ I think that reason is bogus, btw - it should just do what the regular code does, which is to call the "pte_hole()" function for such hugetlb entries - Linus] However, some callers don't check it now, which causes unpredictable result, for example when we have a race between migrating hugepage and reading /proc/pid/numa_maps. This patch fixes it by adding !pte_present checks on buggy callbacks. This bug exists for years and got visible by introducing hugepage migration. ChangeLog v2: - fix if condition (check !pte_present() instead of pte_present()) Reported-by: Sasha Levin Signed-off-by: Naoya Horiguchi Cc: Rik van Riel Cc: [3.12+] Signed-off-by: Andrew Morton [ Backported to 3.15. Signed-off-by: Josh Boyer ] Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed