linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] mm/memory: fix handling of PTE markers in insert_page_into_pte_locked()
@ 2026-11-17 15:58 Mike Rapoport (Microsoft)
  2026-11-17 15:58 ` [PATCH 1/3] mm/memory: install new PTEs first " Mike Rapoport (Microsoft)
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Mike Rapoport (Microsoft) @ 2026-11-17 15:58 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand
  Cc: Jan Kara, Jingyi Sun, Liam R. Howlett, Lorenzo Stoakes,
	Matthew Wilcox, Michal Hocko, Mike Rapoport, Muhammad Usama Anjum,
	Peter Xu, Suren Baghdasaryan, Vlastimil Babka, linux-kernel,
	linux-mm, nvdimm

Jingyi reported that a uffd-wp marker in a DAX mapping causes endless
refaults on reads and SIGBUS on writes [1].

The root cause is that insert_page_into_pte_locked() treats every PTE that
is not none as a present mapping. Besides uffd-wp markers, this also
affects guard markers that MADV_GUARD_INSTALL can put into a DAX mapping
concurrently with a write fault.

The first patch restructures insert_page_into_pte_locked() to make room
for the fixes, the second patch fixes the reported issue and the third
makes write faults back off on non-present PTEs.

Both issues were reproduced on ext4 with dax=always on emulated pmem, and
the fixes were verified with these reproducers.
selftests.

[1] https://lore.kernel.org/all/tencent_1874C71D4177A1624528043E008DB1A5EF05@qq.com

---
Mike Rapoport (Microsoft) (3):
      mm/memory: install new PTEs first in insert_page_into_pte_locked()
      mm/memory: replace uffd-wp markers in insert_page_into_pte_locked()
      mm/memory: don't upgrade non-present PTEs in insert_page_into_pte_locked()

 mm/memory.c | 68 +++++++++++++++++++++++++++++++------------------------------
 1 file changed, 35 insertions(+), 33 deletions(-)
---
base-commit: 93d7a816a2df3e907e2719bd12b0073f1285fc5c
change-id: 20261117-uffd-dax-async-wp-fix-867acc8dc78f

--
Sincerely yours,
Mike.



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

end of thread, other threads:[~2026-11-17 20:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-17 15:58 [PATCH 0/3] mm/memory: fix handling of PTE markers in insert_page_into_pte_locked() Mike Rapoport (Microsoft)
2026-11-17 15:58 ` [PATCH 1/3] mm/memory: install new PTEs first " Mike Rapoport (Microsoft)
2026-11-17 15:58 ` [PATCH 2/3] mm/memory: replace uffd-wp markers " Mike Rapoport (Microsoft)
2026-11-17 15:58 ` [PATCH 3/3] mm/memory: don't upgrade non-present PTEs " Mike Rapoport (Microsoft)
2026-11-17 16:22 ` [PATCH 0/3] mm/memory: fix handling of PTE markers " David Hildenbrand (Arm)
2026-11-17 19:31   ` Mike Rapoport
2026-11-17 20:19     ` David Hildenbrand (Arm)

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