This is a note to let you know that I've just added the patch titled mm: fix potential infinite loop in dissolve_free_huge_pages() to the 3.16-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: mm-fix-potential-infinite-loop-in-dissolve_free_huge_pages.patch and it can be found in the queue-3.16 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From d0177639310d23c7739500df3c6ce6fdfe34acec Mon Sep 17 00:00:00 2001 From: Li Zhong <zhong@xxxxxxxxxxxxxxxxxx> Date: Wed, 6 Aug 2014 16:07:56 -0700 Subject: mm: fix potential infinite loop in dissolve_free_huge_pages() From: Li Zhong <zhong@xxxxxxxxxxxxxxxxxx> commit d0177639310d23c7739500df3c6ce6fdfe34acec upstream. It is possible for some platforms, such as powerpc to set HPAGE_SHIFT to 0 to indicate huge pages not supported. When this is the case, hugetlbfs could be disabled during boot time: hugetlbfs: disabling because there are no supported hugepage sizes Then in dissolve_free_huge_pages(), order is kept maximum (64 for 64bits), and the for loop below won't end: for (pfn = start_pfn; pfn < end_pfn; pfn += 1 << order) As suggested by Naoya, below fix checks hugepages_supported() before calling dissolve_free_huge_pages(). [rientjes@xxxxxxxxxx: no legitimate reason to call dissolve_free_huge_pages() when !hugepages_supported()] Signed-off-by: Li Zhong <zhong@xxxxxxxxxxxxxxxxxx> Acked-by: Naoya Horiguchi <n-horiguchi@xxxxxxxxxxxxx> Acked-by: David Rientjes <rientjes@xxxxxxxxxx> Signed-off-by: David Rientjes <rientjes@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- mm/hugetlb.c | 3 +++ 1 file changed, 3 insertions(+) --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1089,6 +1089,9 @@ void dissolve_free_huge_pages(unsigned l unsigned long pfn; struct hstate *h; + if (!hugepages_supported()) + return; + /* Set scan step to minimum hugepage size */ for_each_hstate(h) if (order > huge_page_order(h)) Patches currently in stable-queue which might be from zhong@xxxxxxxxxxxxxxxxxx are queue-3.16/mm-fix-potential-infinite-loop-in-dissolve_free_huge_pages.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html