Skip to content

mm/pagewalk: fix stale walk->action escaping walk_pmd_range()

Hyunwoo Kim linux-mm lkml stable 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 11 repliesIn review 1 of 2 applied
  2. v11 patch 4 repliesSuperseded

Changes in v2 from the cover letter

- 1/2: reworked the changelog along the lines Lorenzo suggested and said how the bug was found; the fix itself is unchanged (Lorenzo)
- 2/2: new, races smaps against MADV_DONTNEED and checks that Rss does not come out twice as large as what was faulted in (Lorenzo)
- v1: https://lore.kernel.org/r/anmdrYGVqM-U4vlo@v4bel

Patches in v2 1 of 2 applied

#Subject and filesSizeRepliesApplied
1/2mm/pagewalk: fix stale walk->action escaping walk_pmd_range()mm/pagewalk.c+2 -45 repliesApplied
2/2selftests/mm: add stale walk->action race testtools/testing/selftests/mm/.gitignore tools/testing/selftests/mm/Makefile tools/testing/selftests/mm/ksft_pagewalk.sh +3 more+148 -06 replies

Reviews trailers per patch

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

PatchLorenzo Stoakes (ARM)David Hildenbrand (Arm)
1/2R-b A-b
2/2

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/pagewalk: fix stale walk->action escaping walk_pmd_range()

walk_pmd_range() could return with walk->action left at ACTION_AGAIN, which causes walk_pud_range() to retry the PUD walk and invoke the walk callbacks twice over the same range.

Patch 1 is the fix. Patch 2 adds a regression test for it.

Changes in v2:
- 1/2: reworked the changelog along the lines Lorenzo suggested and said how the bug was found; the fix itself is unchanged (Lorenzo)
- 2/2: new, races smaps against MADV_DONTNEED and checks that Rss does not come out twice as large as what was faulted in (Lorenzo)
- v1: https://lore.kernel.org/r/anmdrYGVqM-U4vlo@v4bel

Hyunwoo Kim (2):
mm/pagewalk: fix stale walk->action escaping walk_pmd_range() selftests/mm: add stale walk->action race test

 mm/pagewalk.c                                 |   6 +-
 tools/testing/selftests/mm/.gitignore         |   1 +
 tools/testing/selftests/mm/Makefile           |   2 +
 tools/testing/selftests/mm/ksft_pagewalk.sh   |   4 +
 .../testing/selftests/mm/pagewalk_race_test.c | 138 ++++++++++++++++++
 tools/testing/selftests/mm/run_vmtests.sh     |   2 +
 tools/testing/selftests/mm/vm_util.h          |   1 +
 7 files changed, 150 insertions(+), 4 deletions(-)
 create mode 100755 tools/testing/selftests/mm/ksft_pagewalk.sh
 create mode 100644 tools/testing/selftests/mm/pagewalk_race_test.c
Signature · 1 line
2.43.0