linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/2] mm/hugetlb: uffd-wp fixes for hugetlb_change_protection()
@ 2022-12-22 20:55 David Hildenbrand
  2022-12-22 20:55 ` [PATCH v1 1/2] mm/hugetlb: fix PTE marker handling in hugetlb_change_protection() David Hildenbrand
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: David Hildenbrand @ 2022-12-22 20:55 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-mm, David Hildenbrand, Andrew Morton, Mike Kravetz,
	Peter Xu, Muchun Song, Miaohe Lin

Playing with virtio-mem and background snapshots (using uffd-wp) on
hugetlb in QEMU, I managed to trigger a VM_BUG_ON(). Looking into the
details, hugetlb_change_protection() seems to not handle uffd-wp correctly
in all cases.

Patch #1 fixes my test case. I don't have reproducers for patch #2, as
it requires running into migration entries.

I did not yet check in detail yet if !hugetlb code requires similar care.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Miaohe Lin <linmiaohe@huawei.com>

David Hildenbrand (2):
  mm/hugetlb: fix PTE marker handling in hugetlb_change_protection()
  mm/hugetlb: fix uffd-wp handling for migration entries in
    hugetlb_change_protection()

 mm/hugetlb.c | 38 ++++++++++++++++----------------------
 1 file changed, 16 insertions(+), 22 deletions(-)

-- 
2.38.1



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

end of thread, other threads:[~2022-12-22 23:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-22 20:55 [PATCH v1 0/2] mm/hugetlb: uffd-wp fixes for hugetlb_change_protection() David Hildenbrand
2022-12-22 20:55 ` [PATCH v1 1/2] mm/hugetlb: fix PTE marker handling in hugetlb_change_protection() David Hildenbrand
2022-12-22 22:57   ` Mike Kravetz
2022-12-22 20:55 ` [PATCH v1 2/2] mm/hugetlb: fix uffd-wp handling for migration entries " David Hildenbrand
2022-12-22 23:20   ` Mike Kravetz
2022-12-22 21:17 ` [PATCH v1 0/2] mm/hugetlb: uffd-wp fixes for hugetlb_change_protection() Peter Xu
2022-12-22 21:28   ` Peter Xu

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