mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] mm/userfaultfd: prevent poison marker loss
@ 2026-11-06 23:51 David Hildenbrand (Arm)
  2026-11-06 23:51 ` [PATCH 1/2] " David Hildenbrand (Arm)
  2026-11-06 23:51 ` [PATCH 2/2] mm/khugepaged: check for empty PTE tables before retracting David Hildenbrand (Arm)
  0 siblings, 2 replies; 3+ messages in thread
From: David Hildenbrand (Arm) @ 2026-11-06 23:51 UTC (permalink / raw)
  To: Jonathan Corbet, Shuah Khan, Randy Dunlap, Andrew Morton,
	Liam R. Howlett, Lorenzo Stoakes, Vlastimil Babka, Jann Horn,
	Pedro Falcato, Mike Rapoport, Suren Baghdasaryan, Michal Hocko,
	Peter Xu, Steven Rostedt, Masami Hiramatsu, Mathieu Desnoyers,
	Zi Yan, Baolin Wang, Nico Pache, Ryan Roberts, Dev Jain,
	Barry Song, Lance Yang, Usama Arif, Kiryl Shutsemau,
	Axel Rasmussen
  Cc: linux-kernel, linux-fsdevel, linux-doc, linux-mm,
	linux-trace-kernel, David Hildenbrand (Arm)

Now that Lorenzo's atomic vma flag fixes are in, we can also use it
for userfaultfd POISON markers.

In patch #1, we use a new VM_MAYBE_UFFD_POISON to remember that we had
POISON markers installed by uffd. We then use that to fix marker
handling during fork(), during hugetlb PMD table sharing, and during
retract_page_tables().

In patch #2, we perform a similar rework to retract_page_tables()[1] that
we did to try_collapse_pte_mapped_thp(), to make the code simpler and
less error-prone.

Once review finished, I will take this through core.git, where it
depends on a related try_collapse_pte_mapped_thp() cleanup/fix.

This is not urgent, just something that should be fixed properly.

[1] https://lore.kernel.org/linux-mm/20261031-fixes_core-v3-18-d6437171ecc3@kernel.org/

Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
---
David Hildenbrand (Arm) (2):
      mm/userfaultfd: prevent poison marker loss
      mm/khugepaged: check for empty PTE tables before retracting

 Documentation/filesystems/proc.rst |   1 +
 fs/proc/task_mmu.c                 |   3 +
 include/linux/mm.h                 |  45 ++++++++-----
 include/linux/userfaultfd_k.h      |   7 ++-
 include/trace/events/mmflags.h     |   9 ++-
 mm/Kconfig                         |   1 +
 mm/khugepaged.c                    | 126 +++++++++++++------------------------
 mm/userfaultfd.c                   |   3 +
 tools/testing/vma/include/dup.h    |  20 ++++--
 9 files changed, 110 insertions(+), 105 deletions(-)

---

base-commit: df3c65887715e66e2cba69116924020c37996cd8

change-id: 20261106-b4-uffd_marker_loss-f0f56ec12ce6

--

Cheers,

David


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

end of thread, other threads:[~2026-11-06 23:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-06 23:51 [PATCH 0/2] mm/userfaultfd: prevent poison marker loss David Hildenbrand (Arm)
2026-11-06 23:51 ` [PATCH 1/2] " David Hildenbrand (Arm)
2026-11-06 23:51 ` [PATCH 2/2] mm/khugepaged: check for empty PTE tables before retracting 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

all inboxes | Powered by JetHome®