linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] mm/hugetlb: fix write-fault handling for shared mappings
@ 2022-08-11 10:34 David Hildenbrand
  2022-08-11 10:34 ` [PATCH v2 1/2] mm/hugetlb: fix hugetlb not supporting softdirty tracking David Hildenbrand
  2022-08-11 10:34 ` [PATCH v2 2/2] mm/hugetlb: support write-faults in shared mappings David Hildenbrand
  0 siblings, 2 replies; 15+ messages in thread
From: David Hildenbrand @ 2022-08-11 10:34 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-mm, David Hildenbrand

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
-- 
2.35.3


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

end of thread, other threads:[~2022-08-16 20:44 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-11 10:34 [PATCH v2 0/2] mm/hugetlb: fix write-fault handling for shared mappings David Hildenbrand
2022-08-11 10:34 ` [PATCH v2 1/2] mm/hugetlb: fix hugetlb not supporting softdirty tracking David Hildenbrand
2022-08-11 18:27   ` Mike Kravetz
2022-08-11 10:34 ` [PATCH v2 2/2] mm/hugetlb: support write-faults in shared mappings David Hildenbrand
2022-08-11 13:59   ` Peter Xu
2022-08-11 16:24     ` David Hildenbrand
2022-08-11 18:59   ` Mike Kravetz
2022-08-15 13:35     ` Gerald Schaefer
2022-08-15 15:07       ` David Hildenbrand
2022-08-15 15:59         ` Gerald Schaefer
2022-08-15 18:03           ` David Hildenbrand
2022-08-15 18:38             ` Gerald Schaefer
2022-08-15 21:43               ` Mike Kravetz
2022-08-16  9:33                 ` Gerald Schaefer
2022-08-16 20:43                   ` David Hildenbrand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).