userfaultfd/pagemap: pre-existing fixes
Status from this message: [merged mm-stable] userfaultfd-build-__vma_uffd_flags-from-config-gated-masks.patch removed from -mm tree
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 All 6 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | fs/proc/task_mmu: fix make_uffd_wp_huge_pte() prot-update racefs/ | +8 | 5 replies | Applied |
| 2/6 | fs/proc/task_mmu: use huge_page_size() in pagemap_scan_hugetlb_entry()fs/ | +1 | 2 replies | Applied |
| 3/6 | fs/proc/task_mmu: fix hugetlb self-deadlock in pagemap_scan_pte_hole()fs/ | +58 | 0 replies | Applied |
| 4/6 | mm/huge_memory: preserve pmd_swp_uffd_wp on device-private PMD downgrademm/ | +2 | 1 reply | Applied |
| 5/6 | userfaultfd: gate must_wait writability check on pte_present()mm/ | +20 | 2 replies | Applied |
| 6/6 | userfaultfd: build __VMA_UFFD_FLAGS from config-gated masksinclude/ include/ | +41 | 3 replies | Applied |
Reviews trailers per patch
5 of 6 patches have a Reviewed-by or Acked-by.
| Patch | Balbir Singh | Lorenzo Stoakes | Dev Jain | Mike Rapoport (Microsoft) |
|---|---|---|---|---|
| 1/6 | R-b | R-b | ||
| 2/6 | R-b | R-b | ||
| 3/6 | ||||
| 4/6 | R-b | |||
| 5/6 | R-b | R-b | ||
| 6/6 | R-b | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.
Cover letter [PATCH 0/6] userfaultfd/pagemap: pre-existing fixes
These are pre-existing bug fixes that were carried at the front of the userfaultfd RWP working-set-tracking series up to v5 [1]. Per review feedback that fixes should not sit in the middle of a feature series, they are split out and sent on their own; the RWP series is reposted rebased on top of this.
All six were flagged by the Sashiko AI review of the RWP series and carry Reported-by: Sashiko AI review <[email protected]>. They are independent of RWP, apply to mm-new directly, and carry Cc: stable@.
1: fs/proc/task_mmu: a missing huge_ptep_modify_prot_start() in
make_uffd_wp_huge_pte() can lose hardware Dirty/Accessed updates when PAGEMAP_SCAN write-protects a hugetlb PTE.
2: fs/proc/task_mmu: pagemap_scan_hugetlb_entry() compares the range
against HPAGE_SIZE rather than the hstate page size, so it never write-protects gigantic hugetlb pages.
3: fs/proc/task_mmu: PAGEMAP_SCAN with PM_SCAN_WP_MATCHING over an
unpopulated hugetlb range self-deadlocks -- pagemap_scan_pte_hole() calls uffd_wp_range() while walk_hugetlb_range() holds the hugetlb vma lock for read, and hugetlb_change_protection() then takes it for write. Install the marker inline instead.
4: mm/huge_memory: change_non_present_huge_pmd() drops pmd_swp_uffd_wp
on a device-private PMD permission downgrade, silently losing the uffd-wp marker.
5: userfaultfd: must_wait() applies pte_write() to a locklessly read
PTE without checking pte_present(), so swap/migration entries decode random offset bits and a thread can stay parked on a stale fault.
6: userfaultfd: __VMA_UFFD_FLAGS feeds VMA_UFFD_MINOR_BIT (41) to
mk_vma_flags() unconditionally, an out-of-bounds write into the single-word vma_flags_t on 32-bit. Build the mask from config-gated per-mode masks so an unavailable bit is never materialised.
[1] https://lore.kernel.org/all/[email protected]/
Kiryl Shutsemau (Meta) (6):
fs/proc/task_mmu: fix make_uffd_wp_huge_pte() prot-update race fs/proc/task_mmu: use huge_page_size() in pagemap_scan_hugetlb_entry() fs/proc/task_mmu: fix hugetlb self-deadlock in pagemap_scan_pte_hole() mm/huge_memory: preserve pmd_swp_uffd_wp on device-private PMD
downgrade
userfaultfd: gate must_wait writability check on pte_present()
userfaultfd: build __VMA_UFFD_FLAGS from config-gated masks
fs/proc/task_mmu.c | 73 ++++++++++++++++++++++++++++++++--- include/linux/mm.h | 39 +++++++++++++++++++ include/linux/userfaultfd_k.h | 4 +- mm/huge_memory.c | 2 + mm/userfaultfd.c | 20 ++++++++++ 5 files changed, 130 insertions(+), 8 deletions(-)
base-commit: 449a5df98f8dffa9b037e3b6838fc5af327df072
Signature · 1 line
2.54.0