All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "powerpc/mm: Fix crash in page table dump with huge pages" has been added to the 4.11-stable tree
@ 2017-05-23 14:45 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-05-23 14:45 UTC (permalink / raw)
  To: mpe, gregkh; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    powerpc/mm: Fix crash in page table dump with huge pages

to the 4.11-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:
     powerpc-mm-fix-crash-in-page-table-dump-with-huge-pages.patch
and it can be found in the queue-4.11 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From bfb9956ab4d8242f4594b5f4bee534b935384fd9 Mon Sep 17 00:00:00 2001
From: Michael Ellerman <mpe@ellerman.id.au>
Date: Tue, 16 May 2017 20:42:53 +1000
Subject: powerpc/mm: Fix crash in page table dump with huge pages

From: Michael Ellerman <mpe@ellerman.id.au>

commit bfb9956ab4d8242f4594b5f4bee534b935384fd9 upstream.

The page table dump code doesn't know about huge pages, so currently
it crashes (or walks random memory, usually leading to a crash), if it
finds a huge page. On Book3S we only see huge pages in the Linux page
tables when we're using the P9 Radix MMU.

Teaching the code to properly handle huge pages is a bit more involved,
so for now just prevent the crash.

Fixes: 8eb07b187000 ("powerpc/mm: Dump linux pagetables")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/powerpc/mm/dump_linuxpagetables.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

--- a/arch/powerpc/mm/dump_linuxpagetables.c
+++ b/arch/powerpc/mm/dump_linuxpagetables.c
@@ -16,6 +16,7 @@
  */
 #include <linux/debugfs.h>
 #include <linux/fs.h>
+#include <linux/hugetlb.h>
 #include <linux/io.h>
 #include <linux/mm.h>
 #include <linux/sched.h>
@@ -331,7 +332,7 @@ static void walk_pmd(struct pg_state *st
 
 	for (i = 0; i < PTRS_PER_PMD; i++, pmd++) {
 		addr = start + i * PMD_SIZE;
-		if (!pmd_none(*pmd))
+		if (!pmd_none(*pmd) && !pmd_huge(*pmd))
 			/* pmd exists */
 			walk_pte(st, pmd, addr);
 		else
@@ -347,7 +348,7 @@ static void walk_pud(struct pg_state *st
 
 	for (i = 0; i < PTRS_PER_PUD; i++, pud++) {
 		addr = start + i * PUD_SIZE;
-		if (!pud_none(*pud))
+		if (!pud_none(*pud) && !pud_huge(*pud))
 			/* pud exists */
 			walk_pmd(st, pud, addr);
 		else
@@ -367,7 +368,7 @@ static void walk_pagetables(struct pg_st
 	 */
 	for (i = 0; i < PTRS_PER_PGD; i++, pgd++) {
 		addr = KERN_VIRT_START + i * PGDIR_SIZE;
-		if (!pgd_none(*pgd))
+		if (!pgd_none(*pgd) && !pgd_huge(*pgd))
 			/* pgd exists */
 			walk_pud(st, pgd, addr);
 		else


Patches currently in stable-queue which might be from mpe@ellerman.id.au are

queue-4.11/powerpc-book3s-mce-move-add_taint-later-in-virtual-mode.patch
queue-4.11/powerpc-mm-fix-crash-in-page-table-dump-with-huge-pages.patch
queue-4.11/powerpc-tm-fix-fp-and-vmx-register-corruption.patch
queue-4.11/powerpc-sysfs-fix-reference-leak-of-cpu-device_nodes-present-at-boot.patch
queue-4.11/powerpc-powernv-fix-tce-kill-on-nvlink2.patch
queue-4.11/cxl-force-context-lock-during-eeh-flow.patch
queue-4.11/cxl-route-eeh-events-to-all-drivers-in-cxl_pci_error_detected.patch
queue-4.11/powerpc-pseries-fix-of_node_put-underflow-during-dlpar-remove.patch
queue-4.11/powerpc-iommu-do-not-call-pagetranshuge-on-tail-pages.patch
queue-4.11/powerpc-mm-ensure-irqs-are-off-in-switch_mm.patch
queue-4.11/powerpc-eeh-avoid-use-after-free-in-eeh_handle_special_event.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-05-23 14:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-23 14:45 Patch "powerpc/mm: Fix crash in page table dump with huge pages" has been added to the 4.11-stable tree gregkh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.