From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752118AbdKKUTv (ORCPT ); Sat, 11 Nov 2017 15:19:51 -0500 Received: from mga01.intel.com ([192.55.52.88]:65262 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752024AbdKKUTt (ORCPT ); Sat, 11 Nov 2017 15:19:49 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,379,1505804400"; d="scan'208";a="3887936" Subject: [PATCH v2 0/4] fix device-dax pud crash and fixup {pte, pmd, pud}_write From: Dan Williams To: akpm@linux-foundation.org Cc: Arnd Bergmann , linux-mm@kvack.org, Catalin Marinas , x86@kernel.org, Heiko Carstens , linux-kernel@vger.kernel.org, Will Deacon , Dave Hansen , =?utf-8?b?SsOpcsO0bWU=?= Glisse , Ingo Molnar , stable@vger.kernel.org, "H. Peter Anvin" , Martin Schwidefsky , Thomas Gleixner , "David S. Miller" , "Kirill A. Shutemov" , linux-nvdimm@lists.01.org Date: Sat, 11 Nov 2017 12:11:34 -0800 Message-ID: <151043109403.2842.11607911965674122836.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.17.1-9-g687f MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Changes since v1 [1]: * fix arm64 compilation, add __HAVE_ARCH_PUD_WRITE * fix sparc64 compilation, add __HAVE_ARCH_PUD_WRITE * fix s390 compilation, add a pud_write() helper --- Andrew, Here is a third version to the pud_write() fix [2], and some follow-on patches to use the '_access_permitted' helpers in fault and get_user_pages() paths where we are checking if the thread has access to write. I explicitly omit conversions for places where the kernel is checking the _PAGE_RW flag for kernel purposes, not for userspace access. Beyond fixing the crash, this series also fixes get_user_pages() and fault paths to honor protection keys in the same manner as get_user_pages_fast(). Only the crash fix is tagged for -stable as the protection key check is done just for consistency reasons since userspace can change protection keys at will. [1]: https://lists.01.org/pipermail/linux-nvdimm/2017-November/013249.html [2]: https://lists.01.org/pipermail/linux-nvdimm/2017-November/013237.html --- Dan Williams (4): mm: fix device-dax pud write-faults triggered by get_user_pages() mm: replace pud_write with pud_access_permitted in fault + gup paths mm: replace pmd_write with pmd_access_permitted in fault + gup paths mm: replace pte_write with pte_access_permitted in fault + gup paths arch/arm64/include/asm/pgtable.h | 1 + arch/s390/include/asm/pgtable.h | 6 ++++++ arch/sparc/include/asm/pgtable_64.h | 1 + arch/sparc/mm/gup.c | 4 ++-- arch/x86/include/asm/pgtable.h | 6 ++++++ fs/dax.c | 3 ++- include/asm-generic/pgtable.h | 9 +++++++++ include/linux/hugetlb.h | 8 -------- mm/gup.c | 2 +- mm/hmm.c | 8 ++++---- mm/huge_memory.c | 6 +++--- mm/memory.c | 8 ++++---- 12 files changed, 39 insertions(+), 23 deletions(-)