Skip to content

mm/hugetlb: uffd-wp fixes for hugetlb_change_protection()

David Hildenbrand linux-mm lkml stable 1 version Applied

Status from this message: [merged mm-hotfixes-stable] mm-hugetlb-fix-uffd-wp-handling-for-migration-entries-in-hugetlb_change_protection.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 4 repliesApplied 2/2

Patches in v1 All 2 applied

#Subject and filesSizeRepliesApplied
1/2mm/hugetlb: fix PTE marker handling in hugetlb_change_protection()mm/hugetlb.c+7 -141 replyApplied
2/2mm/hugetlb: fix uffd-wp handling for migration entries in hugetlb_change_protection()mm/hugetlb.c+9 -81 replyApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchPeter XuMike Kravetz
SeriesR-b
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 v1 thread

Cover letter [PATCH v1 0/2] mm/hugetlb: uffd-wp fixes for hugetlb_change_protection()

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 <[email protected]>
Cc Mike Kravetz <[email protected]>
Cc Peter Xu <[email protected]>
Cc Muchun Song <[email protected]>
Cc Miaohe Lin <[email protected]>

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(-)
Signature · 1 line
2.38.1