Andrew, please squash this small patch with this one. It directly addresses a problem found in review.
(I was told this is the preferred way to send small fixups, and I don't think anyone wants a v4 over this trivial issue)
Thank you!
----8<---- From 614e5dc27073c39579c863ebdff4396948e28e03 Mon Sep 17 00:00:00 2001 From: Pedro Falcato pedro.falcato@gmail.com Date: Thu, 22 Aug 2024 00:20:19 +0100 Subject: [PATCH] selftests/mm: Fix mseal's length
We accidentally msealed too much, which could overrun and try to mseal other regions. This seems to be harmless (at least on top-down architectures) due to various reasons all aligning, but may very well cause spurious test failures to e.g bottom-up mmap architectures.
Signed-off-by: Pedro Falcato pedro.falcato@gmail.com --- tools/testing/selftests/mm/mseal_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/mm/mseal_test.c b/tools/testing/selftests/mm/mseal_test.c index 0d4d40fb0f88..0c41513219ae 100644 --- a/tools/testing/selftests/mm/mseal_test.c +++ b/tools/testing/selftests/mm/mseal_test.c @@ -783,7 +783,7 @@ static void test_seal_mprotect_partial_mprotect_tail(bool seal) FAIL_TEST_IF_FALSE(ptr != (void *)-1);
if (seal) { - ret = sys_mseal(ptr + page_size, size); + ret = sys_mseal(ptr + page_size, page_size); FAIL_TEST_IF_FALSE(!ret); }
@@ -1036,7 +1036,7 @@ static void test_seal_munmap_partial_across_vmas(bool seal) FAIL_TEST_IF_FALSE(ptr != (void *)-1);
if (seal) { - ret = sys_mseal(ptr + page_size, size); + ret = sys_mseal(ptr + page_size, page_size); FAIL_TEST_IF_FALSE(!ret); }