Skip to content

mm/hugetlb: fix write-fault handling for shared mappings

David Hildenbrand linux-mm linux-s390 lkml stable 2 versions – Applied

Status from this message: [merged mm-hotfixes-stable] mm-hugetlb-support-write-faults-in-shared-mappings.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 12 repliesApplied 2/2
  2. v12 patches 27 repliesSuperseded

Changes in v2 from the cover letter

- "mm/hugetlb: fix hugetlb not supporting softdirty tracking" -> Restrict to softdirty tracking
- "mm/hugetlb: support write-faults in shared mappings" -> Add reproducer and adjust description
-> Move VM_WRITE sanity check out from MAYSHARE handling

Patches in v2 All 2 applied

#Subject and filesSizeRepliesApplied
1/2mm/hugetlb: fix hugetlb not supporting softdirty trackingmm/mmap.c+5 -21 replyApplied
2/2mm/hugetlb: support write-faults in shared mappingsmm/hugetlb.c+19 -711 repliesApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchMike Kravetz
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/2] mm/hugetlb: fix write-fault handling for shared mappings

I observed that hugetlb does not support/expect write-faults in shared mappings that would have to map the R/O-mapped page writable -- and I found two case where we could currently get such faults and would erroneously map an anon page into a shared mapping.

Reproducers part of the patches.

I propose to backport both fixes to stable trees. The first fix needs a small adjustment.

v1 -> v2:
- "mm/hugetlb: fix hugetlb not supporting softdirty tracking" -> Restrict to softdirty tracking
- "mm/hugetlb: support write-faults in shared mappings" -> Add reproducer and adjust description
-> Move VM_WRITE sanity check out from MAYSHARE handling

David Hildenbrand (2):
mm/hugetlb: fix hugetlb not supporting softdirty tracking mm/hugetlb: support write-faults in shared mappings

 mm/hugetlb.c | 26 +++++++++++++++++++-------
 mm/mmap.c    |  7 +++++--
 2 files changed, 24 insertions(+), 9 deletions(-)

base-commit: ffcf9c5700e49c0aee42dcba9a12ba21338e8136

Signature · 1 line
2.35.3