* [LTP] [PATCH] [RESEND] syscalls/mprotect01: map /dev/zero instead of /etc/passwd
@ 2018-03-27 17:37 Sandeep Patil
2018-04-04 7:38 ` Cyril Hrubis
0 siblings, 1 reply; 2+ messages in thread
From: Sandeep Patil @ 2018-03-27 17:37 UTC (permalink / raw)
To: ltp
The test creates a read-only map for /etc/passwd to test
against errors returned by mprotect with PROT_WRITE. This
doesn't work in Android systems (no /etc/passwd)
More portable solution is to replace /etc/passwd with
/dev/zero instead. That fixes the problem for Android
systems
Signed-off-by: Sandeep Patil <sspatil@google.com>
---
testcases/kernel/syscalls/mprotect/mprotect01.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/testcases/kernel/syscalls/mprotect/mprotect01.c b/testcases/kernel/syscalls/mprotect/mprotect01.c
index 7c4f10e02..be4d982ea 100644
--- a/testcases/kernel/syscalls/mprotect/mprotect01.c
+++ b/testcases/kernel/syscalls/mprotect/mprotect01.c
@@ -137,8 +137,8 @@ static void setup2(struct test_case *self)
static void setup3(struct test_case *self)
{
- fd = SAFE_OPEN(cleanup, "/etc/passwd", O_RDONLY);
-
+ fd = SAFE_OPEN(cleanup, "/dev/zero", O_RDONLY);
+
self->len = getpagesize();
/*
--
2.17.0.rc0.231.g781580f067-goog
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-04-04 7:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-27 17:37 [LTP] [PATCH] [RESEND] syscalls/mprotect01: map /dev/zero instead of /etc/passwd Sandeep Patil
2018-04-04 7:38 ` Cyril Hrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox