From 3fc2b91a82c2ddc780d8b6b11390ec9ce4e4255c Mon Sep 17 00:00:00 2001 From: netblue30 Date: Sat, 18 Dec 2021 19:07:08 -0500 Subject: testing --- test/filters/memwrexe | Bin 17096 -> 17096 bytes test/filters/memwrexe-32 | Bin 6678 -> 15800 bytes test/filters/memwrexe.c | 14 ++++++++++++-- 3 files changed, 12 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/filters/memwrexe b/test/filters/memwrexe index 669f0d320..1173cdc07 100755 Binary files a/test/filters/memwrexe and b/test/filters/memwrexe differ diff --git a/test/filters/memwrexe-32 b/test/filters/memwrexe-32 index 70c98b796..bdf71dcb4 100755 Binary files a/test/filters/memwrexe-32 and b/test/filters/memwrexe-32 differ diff --git a/test/filters/memwrexe.c b/test/filters/memwrexe.c index 4fbf05f78..d8bf4edaa 100644 --- a/test/filters/memwrexe.c +++ b/test/filters/memwrexe.c @@ -42,6 +42,11 @@ int main(int argc, char **argv) { } void *p = mmap (0, size, PROT_WRITE|PROT_READ|PROT_EXEC, MAP_SHARED, fd, 0); + if (p == MAP_FAILED) { + printf("mmap failed\n"); + return 0; + } + printf("mmap successful\n"); // wait for expect to timeout @@ -70,7 +75,12 @@ int main(int argc, char **argv) { return 1; } - mprotect(p, size, PROT_READ|PROT_WRITE|PROT_EXEC); + int rv = mprotect(p, size, PROT_READ|PROT_WRITE|PROT_EXEC); + if (rv) { + printf("mprotect failed\n"); + return 1; + } + printf("mprotect successful\n"); // wait for expect to timeout @@ -82,7 +92,7 @@ int main(int argc, char **argv) { else if (strcmp(argv[1], "memfd_create") == 0) { int fd = syscall(SYS_memfd_create, "memfd_create", 0); if (fd == -1) { - fprintf(stderr, "TESTING ERROR: cannot run memfd_create test\n"); + printf("memfd_create failed\n"); return 1; } printf("memfd_create successful\n"); -- cgit v1.2.3-70-g09d2