linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: akpm@linux-foundation.org
Cc: "Stephen Rothwell" <sfr@canb.auug.org.au>,
	"Chris Metcalf" <cmetcalf@mellanox.com>,
	"Arnd Bergmann" <arnd@arndb.de>,
	linux-nvdimm@lists.01.org,
	"Benjamin Herrenschmidt" <benh@kernel.crashing.org>,
	x86@kernel.org, "Heiko Carstens" <heiko.carstens@de.ibm.com>,
	"Russell King" <linux@armlinux.org.uk>,
	"Ralf Baechle" <ralf@linux-mips.org>,
	linux-mm@kvack.org, "Dave Hansen" <dave.hansen@intel.com>,
	"Jérôme Glisse" <jglisse@redhat.com>,
	"Ingo Molnar" <mingo@redhat.com>,
	stable@vger.kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	"Martin Schwidefsky" <schwidefsky@de.ibm.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"David S. Miller" <davem@davemloft.net>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Subject: [PATCH v3 0/5] fix device-dax pud crash and fixup {pte, pmd, pud}_write
Date: Tue, 21 Nov 2017 11:07:36 -0800	[thread overview]
Message-ID: <151129125625.37405.15953656230804875212.stgit@dwillia2-desk3.amr.corp.intel.com> (raw)

Changes since v2 [1]:
* Switch from the "#define __HAVE_ARCH_PUD_WRITE" to "#define
  pud_write". This incidentally fixes a powerpc compile error.
  (Stephen)

* Add a cleanup patch to align pmd_write to the pud_write definition
  scheme.

---

Andrew,

Here is another attempt at 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.

These have received a build success notification from the 0day robot.

[1]: https://lists.01.org/pipermail/linux-nvdimm/2017-November/013254.html
[2]: https://lists.01.org/pipermail/linux-nvdimm/2017-November/013237.html

---

Dan Williams (5):
      mm: fix device-dax pud write-faults triggered by get_user_pages()
      mm: switch to 'define pmd_write' instead of __HAVE_ARCH_PMD_WRITE
      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/arm/include/asm/pgtable-3level.h        |    1 -
 arch/arm64/include/asm/pgtable.h             |    1 -
 arch/mips/include/asm/pgtable.h              |    2 +-
 arch/powerpc/include/asm/book3s/64/pgtable.h |    1 -
 arch/s390/include/asm/pgtable.h              |    8 +++++++-
 arch/sparc/include/asm/pgtable_64.h          |    2 +-
 arch/sparc/mm/gup.c                          |    4 ++--
 arch/tile/include/asm/pgtable.h              |    1 -
 arch/x86/include/asm/pgtable.h               |    8 +++++++-
 fs/dax.c                                     |    3 ++-
 include/asm-generic/pgtable.h                |   12 ++++++++++--
 include/linux/hugetlb.h                      |    8 --------
 mm/gup.c                                     |    2 +-
 mm/hmm.c                                     |    8 ++++----
 mm/huge_memory.c                             |    6 +++---
 mm/memory.c                                  |    8 ++++----
 16 files changed, 42 insertions(+), 33 deletions(-)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

             reply	other threads:[~2017-11-21 19:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-21 19:07 Dan Williams [this message]
2017-11-21 19:07 ` [PATCH v3 1/5] mm: fix device-dax pud write-faults triggered by get_user_pages() Dan Williams
2017-11-21 19:07 ` [PATCH v3 2/5] mm: switch to 'define pmd_write' instead of __HAVE_ARCH_PMD_WRITE Dan Williams
2017-11-21 21:58   ` Benjamin Herrenschmidt
2017-11-21 19:07 ` [PATCH v3 3/5] mm: replace pud_write with pud_access_permitted in fault + gup paths Dan Williams
2017-11-21 19:07 ` [PATCH v3 4/5] mm: replace pmd_write with pmd_access_permitted " Dan Williams
2017-11-21 19:08 ` [PATCH v3 5/5] mm: replace pte_write with pte_access_permitted " Dan Williams

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=151129125625.37405.15953656230804875212.stgit@dwillia2-desk3.amr.corp.intel.com \
    --to=dan.j.williams@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=benh@kernel.crashing.org \
    --cc=cmetcalf@mellanox.com \
    --cc=dave.hansen@intel.com \
    --cc=davem@davemloft.net \
    --cc=heiko.carstens@de.ibm.com \
    --cc=hpa@zytor.com \
    --cc=jglisse@redhat.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-mm@kvack.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=linux@armlinux.org.uk \
    --cc=mingo@redhat.com \
    --cc=ralf@linux-mips.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=sfr@canb.auug.org.au \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox