From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:38686 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966831AbdEWOro (ORCPT ); Tue, 23 May 2017 10:47:44 -0400 Subject: Patch "powerpc/mm: Fix crash in page table dump with huge pages" has been added to the 4.11-stable tree To: mpe@ellerman.id.au, gregkh@linuxfoundation.org Cc: , From: Date: Tue, 23 May 2017 16:45:53 +0200 Message-ID: <149555075336143@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: 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 know about it. >>From bfb9956ab4d8242f4594b5f4bee534b935384fd9 Mon Sep 17 00:00:00 2001 From: Michael Ellerman Date: Tue, 16 May 2017 20:42:53 +1000 Subject: powerpc/mm: Fix crash in page table dump with huge pages From: Michael Ellerman 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 Signed-off-by: Greg Kroah-Hartman --- 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 #include +#include #include #include #include @@ -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