Skip to contentSkip to conversation

selftests-mm-add-self-tests-for-guard-page-feature.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Nov 11, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: selftests/mm: add self tests for guard page feature
has been removed from the -mm tree. Its filename was
selftests-mm-add-self-tests-for-guard-page-feature.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Lorenzo Stoakes <[email protected]>
Subject: selftests/mm: add self tests for guard page feature
Date: Mon, 28 Oct 2024 14:13:31 +0000

Utilise the kselftest harmness to implement tests for the guard page implementation.

We start by implement basic tests asserting that guard pages can be installed, removed and that touching guard pages result in SIGSEGV. We also assert that, in removing guard pages from a range, non-guard pages remain intact.

We then examine different operations on regions containing guard markers behave to ensure correct behaviour:

* Operations over multiple VMAs operate as expected.
* Invoking MADV_GUARD_INSTALL / MADV_GUARD_REMOVE via process_madvise() in batches works correctly.
* Ensuring that munmap() correctly tears down guard markers.
* Using mprotect() to adjust protection bits does not in any way override or cause issues with guard markers.
* Ensuring that splitting and merging VMAs around guard markers causes no issue - i.e. that a marker which 'belongs' to one VMA can function just as well 'belonging' to another.
* Ensuring that madvise(..., MADV_DONTNEED) and madvise(..., MADV_FREE) do not remove guard markers.
* Ensuring that mlock()'ing a range containing guard markers does not cause issues.
* Ensuring that mremap() can move a guard range and retain guard markers.
* Ensuring that mremap() can expand a guard range and retain guard markers (perhaps moving the range).
* Ensuring that mremap() can shrink a guard range and retain guard markers.
* Ensuring that forking a process correctly retains guard markers.
* Ensuring that forking a VMA with VM_WIPEONFORK set behaves sanely.
* Ensuring that lazyfree simply clears guard markers.
* Ensuring that userfaultfd can co-exist with guard pages.
* Ensuring that madvise(..., MADV_POPULATE_READ) and madvise(..., MADV_POPULATE_WRITE) error out when encountering guard markers.
* Ensuring that madvise(..., MADV_COLD) and madvise(..., MADV_PAGEOUT) do not remove guard markers.

If any test is unable to be run due to lack of permissions, that test is skipped.

Cc Arnd Bergmann <[email protected]>
Cc Christian Brauner <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc Chris Zankel <[email protected]>
Cc Helge Deller <[email protected]>
Cc James E.J. Bottomley <[email protected]>
Cc Jeff Xu <[email protected]>
Cc John Hubbard <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Matthew Wilcox (Oracle) <[email protected]>
Cc Matt Turner <[email protected]>
Cc Max Filippov <[email protected]>
Cc Muchun Song <[email protected]>
Cc Paul E. McKenney <[email protected]>
Cc Richard Henderson <[email protected]>
Cc Shuah Khan <[email protected]>
Cc Sidhartha Kumar <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Thomas Bogendoerfer <[email protected]>
Cc Vlastimil Babka <[email protected]>

---

 tools/testing/selftests/mm/.gitignore    |    1 
 tools/testing/selftests/mm/Makefile      |    1 
 tools/testing/selftests/mm/guard-pages.c | 1243 +++++++++++++++++++++
 3 files changed, 1245 insertions(+)
tools/testing/selftests/mm/.gitignore renamed from tools/testing/selftests/mm/.gitignore~selftests-mm-add-self-tests-for-guard-page-feature +1 -0
@@ -54,3 +54,4 @@ droppable
 hugetlb_dio
 pkey_sighandler_tests_32
 pkey_sighandler_tests_64
+guard-pages
tools/testing/selftests/mm/guard-pages.c new file +1243 -0

1,243 lines not on this page · raw message

tools/testing/selftests/mm/Makefile renamed from tools/testing/selftests/mm/Makefile~selftests-mm-add-self-tests-for-guard-page-feature +1 -0
@@ -79,6 +79,7 @@ TEST_GEN_FILES += hugetlb_fault_after_ma
 TEST_GEN_FILES += hugetlb_madv_vs_map
 TEST_GEN_FILES += hugetlb_dio
 TEST_GEN_FILES += droppable
+TEST_GEN_FILES += guard-pages
 
 ifneq ($(ARCH),arm64)
 TEST_GEN_FILES += soft-dirty

_

Patches currently in -mm which might be from [email protected] are

docs-mm-add-vma-locks-documentation.patch
docs-mm-add-vma-locks-documentation-fix.patch