Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] userfaultfd: fixes for sashiko reports
@ 2026-12-03 17:15 Mike Rapoport (Microsoft)
  2026-12-03 17:15 ` [PATCH v2 1/4] userfaultfd: write-lock the VMA before clearing its uffd state Mike Rapoport (Microsoft)
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Mike Rapoport (Microsoft) @ 2026-12-03 17:15 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand
  Cc: Mike Rapoport, Peter Xu, Suren Baghdasaryan, linux-kernel,
	linux-kselftest, linux-mm, Sashiko

These are fixes for userfaultfd bugs reported by sashiko, plus a THP
variant of one of them found while looking at the reports.

The first patch closes a race between closing a userfaultfd and uffd
operations of another userfaultfd of the same mm that can leave a
writable PTE with the uffd marker bit set.

The next two make UFFDIO_MOVE mark moved zero pages and THPs soft-dirty,
like it does for other PTEs and for the huge zero page.

The last one makes uffd-unit-tests free the test context when its setup
fails.

Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
---
Changes in v2:
- address sashiko findings in selftest
- Link to v1: https://patch.msgid.link/20261202-fixes-uffd-sashiko-v1-0-a6f5a874334a@kernel.org

---
Mike Rapoport (Microsoft) (4):
      userfaultfd: write-lock the VMA before clearing its uffd state
      userfaultfd: mark zero pages moved by UFFDIO_MOVE soft-dirty
      userfaultfd: mark THPs moved by UFFDIO_MOVE soft-dirty
      selftests/mm: free the test context when uffd_test_ctx_init() fails

 mm/huge_memory.c                         |  1 +
 mm/userfaultfd.c                         |  5 +++++
 tools/testing/selftests/mm/uffd-common.c | 27 +++++++++++++++++++++++----
 3 files changed, 29 insertions(+), 4 deletions(-)
---
base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244
change-id: 20261202-fixes-uffd-sashiko-fb173c1557eb

--
Sincerely yours,
Mike.



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

end of thread, other threads:[~2026-12-04  9:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 17:15 [PATCH v2 0/4] userfaultfd: fixes for sashiko reports Mike Rapoport (Microsoft)
2026-12-03 17:15 ` [PATCH v2 1/4] userfaultfd: write-lock the VMA before clearing its uffd state Mike Rapoport (Microsoft)
2026-12-04  9:27   ` Jose A. Perez de Azpillaga
2026-12-03 17:15 ` [PATCH v2 2/4] userfaultfd: mark zero pages moved by UFFDIO_MOVE soft-dirty Mike Rapoport (Microsoft)
2026-12-04  9:31   ` Jose A. Perez de Azpillaga
2026-12-03 17:15 ` [PATCH v2 3/4] userfaultfd: mark THPs " Mike Rapoport (Microsoft)
2026-12-04  9:32   ` Jose A. Perez de Azpillaga
2026-12-03 17:15 ` [PATCH v2 4/4] selftests/mm: free the test context when uffd_test_ctx_init() fails Mike Rapoport (Microsoft)
2026-12-04  9:39   ` Jose A. Perez de Azpillaga

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox