All of lore.kernel.org
 help / color / mirror / Atom feed
From: <gregkh@linuxfoundation.org>
To: mpe@ellerman.id.au, gregkh@linuxfoundation.org
Cc: <stable@vger.kernel.org>, <stable-commits@vger.kernel.org>
Subject: Patch "powerpc/mm: Fix crash in page table dump with huge pages" has been added to the 4.11-stable tree
Date: Tue, 23 May 2017 16:45:53 +0200	[thread overview]
Message-ID: <149555075336143@kroah.com> (raw)


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

                 reply	other threads:[~2017-05-23 14:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=149555075336143@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=mpe@ellerman.id.au \
    --cc=stable-commits@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.