linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] fix device-dax pud crash and fixup {pte, pmd, pud}_write
@ 2017-11-11 20:11 Dan Williams
  2017-11-11 20:11 ` [PATCH v2 1/4] mm: fix device-dax pud write-faults triggered by get_user_pages() Dan Williams
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Dan Williams @ 2017-11-11 20:11 UTC (permalink / raw)
  To: akpm
  Cc: Arnd Bergmann, linux-mm, Catalin Marinas, x86, Heiko Carstens,
	linux-kernel, Will Deacon, Dave Hansen, Jérôme Glisse,
	Ingo Molnar, stable, H. Peter Anvin, Martin Schwidefsky,
	Thomas Gleixner, David S. Miller, Kirill A. Shutemov,
	linux-nvdimm

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(-)

--
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>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-11-23 18:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-11 20:11 [PATCH v2 0/4] fix device-dax pud crash and fixup {pte, pmd, pud}_write Dan Williams
2017-11-11 20:11 ` [PATCH v2 1/4] mm: fix device-dax pud write-faults triggered by get_user_pages() Dan Williams
2017-11-23 18:23   ` Thomas Gleixner
2017-11-11 20:11 ` [PATCH v2 2/4] mm: replace pud_write with pud_access_permitted in fault + gup paths Dan Williams
2017-11-11 20:11 ` [PATCH v2 3/4] mm: replace pmd_write with pmd_access_permitted " Dan Williams
2017-11-11 20:11 ` [PATCH v2 4/4] mm: replace pte_write with pte_access_permitted " Dan Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).