mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/3] mm/hugetlb: fix mremap bugs
@ 2026-10-22  3:45 Li Zhe
  2026-10-22  3:45 ` [PATCH v3 1/3] mm/hugetlb: fix mremap move length truncation Li Zhe
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Li Zhe @ 2026-10-22  3:45 UTC (permalink / raw)
  To: akpm, david, muchun.song, osalvador, peterx, rppt, azpijr
  Cc: linux-kernel, linux-mm, Li Zhe

This series fixes a few hugetlb mremap bugs.

Patch 1 fixes the return type of move_hugetlb_page_tables(), so large
hugetlb moves cannot be truncated when reported back to the generic
mremap code.

Patch 2 disables hugetlb PMD sharing for UFFD missing mode, so
UFFDIO_POISON markers cannot become visible through shared PMD page
tables.

Patch 3 fixes the recursive i_mmap_rwsem deadlock in the hugetlb mremap
path by avoiding the destination PMD sharing allocation path while the
mapping lock is already held for write.

David Hildenbrand (Arm) (1):
  mm/hugetlb: disable PMD sharing for UFFD missing mode

Li Zhe (2):
  mm/hugetlb: fix mremap move length truncation
  mm/hugetlb: fix mremap deadlock when PMD sharing is possible

 include/linux/hugetlb.h       | 15 ++++------
 include/linux/userfaultfd_k.h | 16 ++--------
 mm/hugetlb.c                  | 55 ++++++++++++++++++++++++++---------
 3 files changed, 50 insertions(+), 36 deletions(-)

---
v2: https://lore.kernel.org/all/20261019113034.97690-1-lizhe.67@bytedance.com/
v1: https://lore.kernel.org/all/20260930064308.58159-1-lizhe.67@bytedance.com/

Changes since v2:

- Add Cc: stable@vger.kernel.org to patch 1, as suggested by David.
- Use double-tab indentation for move_hugetlb_page_tables(), as
  suggested by David.
- Disable hugetlb PMD sharing based on the userfaultfd context instead
  of checking individual UFFD mode flags, as suggested by Mike.

-- 
2.20.1

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

end of thread, other threads:[~2026-10-22  6:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-22  3:45 [PATCH v3 0/3] mm/hugetlb: fix mremap bugs Li Zhe
2026-10-22  3:45 ` [PATCH v3 1/3] mm/hugetlb: fix mremap move length truncation Li Zhe
2026-10-22  3:45 ` [PATCH v3 2/3] mm/hugetlb: disable PMD sharing for UFFD missing mode Li Zhe
2026-10-22  6:50   ` Mike Rapoport
2026-10-22  3:45 ` [PATCH v3 3/3] mm/hugetlb: fix mremap deadlock when PMD sharing is possible Li Zhe

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®