selftests/mm: sigbus-wp test requires UFFD_FEATURE_WP_HUGETLBFS_SHMEM
authorEdward Liaw <edliaw@google.com>
Thu, 21 Mar 2024 23:20:21 +0000 (23:20 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 26 Mar 2024 18:07:22 +0000 (11:07 -0700)
The sigbus-wp test requires the UFFD_FEATURE_WP_HUGETLBFS_SHMEM flag for
shmem and hugetlb targets.  Otherwise it is not backwards compatible with
kernels <5.19 and fails with EINVAL.

Link: https://lkml.kernel.org/r/20240321232023.2064975-1-edliaw@google.com
Fixes: 73c1ea939b65 ("selftests/mm: move uffd sig/events tests into uffd unit tests")
Signed-off-by: Edward Liaw <edliaw@google.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Peter Xu <peterx@redhat.com
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/selftests/mm/uffd-unit-tests.c

index 2b9f8cc52639d1942238b41a1ad55edc6bd406ed..536e09b03aee0186cefc77d53536dffa9a4d5dbe 100644 (file)
@@ -1427,7 +1427,8 @@ uffd_test_case_t uffd_tests[] = {
                .uffd_fn = uffd_sigbus_wp_test,
                .mem_targets = MEM_ALL,
                .uffd_feature_required = UFFD_FEATURE_SIGBUS |
-               UFFD_FEATURE_EVENT_FORK | UFFD_FEATURE_PAGEFAULT_FLAG_WP,
+               UFFD_FEATURE_EVENT_FORK | UFFD_FEATURE_PAGEFAULT_FLAG_WP |
+               UFFD_FEATURE_WP_HUGETLBFS_SHMEM,
        },
        {
                .name = "events",