Skip to content

mm/migrate: Fix writable pte for read migration entry

Peter Xu linux-mm lkml stable 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 10 repliesIn review 1 of 2 applied
  2. v22 patches 18 repliesSuperseded
  3. v12 patches 2 repliesSuperseded

Changes in v3 from the cover letter

- Go back to use WARN_ON_ONCE because mmdebug.h not included in arch/x86/include/asm/pgtable.h
- Added r-b and t-b
- s/symbton/symbtom/ [Nadav]
- Updated commit message of patch 1, removing mprotect example

Patches in v3 1 of 2 applied

#Subject and filesSizeRepliesApplied
1/2mm/migrate: Fix read-only page got writable when recover ptemm/migrate.c+7 -110 replies
2/2mm/uffd: Sanity check write bit for uffd-wp protected ptesarch/x86/include/asm/pgtable.h+17 -10 repliesApplied

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchAlistair PoppleIves van Hoorne
1/2R-b T-b
2/2

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

Read the v3 thread

Cover letter [PATCH v3 0/2] mm/migrate: Fix writable pte for read migration entry

v3:
- Go back to use WARN_ON_ONCE because mmdebug.h not included in arch/x86/include/asm/pgtable.h
- Added r-b and t-b
- s/symbton/symbtom/ [Nadav]
- Updated commit message of patch 1, removing mprotect example

v2:
- Replace WARN_ON_ONCE with VM_WARN_ON_ONCE in patch 2 [Nadav]

This comes from a report from Ives on using uffd-wp on shmem. More information can be found in patch 1 commit message.

Patch 2 added some more sanity check when walking pgtables and when we convert the ptes into other forms e.g. for migration and swap. It will make the error trigger even earlier than the user could notice, meanwhile nail down the case if it's a wrong pgtable setup.

We probably need patch 1 for stable (5.19+). Please have a look, thanks.

Peter Xu (2):
mm/migrate: Fix read-only page got writable when recover pte mm/uffd: Sanity check write bit for uffd-wp protected ptes

 arch/x86/include/asm/pgtable.h | 18 +++++++++++++++++-
 mm/migrate.c                   |  8 +++++++-
 2 files changed, 24 insertions(+), 2 deletions(-)
Signature · 1 line
2.37.3