[LTP] [PATCH 1/1] mmap20: Fix invalid address

Petr Vorel pvorel@suse.cz
Tue Apr 4 13:28:52 CEST 2023


1 << 7 (0x80) is defined as MAP_LOCKED on ppc64le and mips.
Use 1 << 9 (0x200), which looks to be unused on all archs.

Fixes: 2764e9e6a ("mmap20: New test for mmap() with MAP_SHARED_VALIDATE")

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
NOTE: (1 << 10) would work as well.

 testcases/kernel/syscalls/mmap/mmap20.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/mmap/mmap20.c b/testcases/kernel/syscalls/mmap/mmap20.c
index c346df5d1..5269179e5 100644
--- a/testcases/kernel/syscalls/mmap/mmap20.c
+++ b/testcases/kernel/syscalls/mmap/mmap20.c
@@ -20,7 +20,7 @@
 
 #define TEST_FILE "file_to_mmap"
 #define TEST_FILE_SIZE 1024
-#define INVALID_FLAG (1 << 7)
+#define INVALID_FLAG (1 << 9)
 
 static int fd = -1;
 static void *addr;
-- 
2.40.0



More information about the ltp mailing list