|
Mark Wielaard |
e4df76 |
commit 917e423073c5eacffbad83008c27c8e61e0e342a
|
|
Mark Wielaard |
e4df76 |
Author: Mark Wielaard <mark@klomp.org>
|
|
Mark Wielaard |
e4df76 |
Date: Mon May 20 00:09:59 2019 +0200
|
|
Mark Wielaard |
e4df76 |
|
|
Mark Wielaard |
e4df76 |
Make memcheck/tests/arm64-linux/scalar test work under root.
|
|
Mark Wielaard |
e4df76 |
|
|
Mark Wielaard |
e4df76 |
Running the testsuite as root isn't really recommended.
|
|
Mark Wielaard |
e4df76 |
But lets not make tests fail unnecessarily when running as root.
|
|
Mark Wielaard |
e4df76 |
Pass really invalid arguments to setuid, setgid, acct and fchown.
|
|
Mark Wielaard |
e4df76 |
Make setresgid, setresuid, setregid and setreuid always succeed.
|
|
Mark Wielaard |
e4df76 |
|
|
Mark Wielaard |
e4df76 |
diff --git a/memcheck/tests/arm64-linux/scalar.c b/memcheck/tests/arm64-linux/scalar.c
|
|
Mark Wielaard |
e4df76 |
index fd49db6..622ea1c 100644
|
|
Mark Wielaard |
e4df76 |
--- a/memcheck/tests/arm64-linux/scalar.c
|
|
Mark Wielaard |
e4df76 |
+++ b/memcheck/tests/arm64-linux/scalar.c
|
|
Mark Wielaard |
e4df76 |
@@ -136,7 +136,7 @@ int main(void)
|
|
Mark Wielaard |
e4df76 |
|
|
Mark Wielaard |
e4df76 |
// __NR_setuid 23
|
|
Mark Wielaard |
e4df76 |
GO(__NR_setuid, "1s 0m");
|
|
Mark Wielaard |
e4df76 |
- SY(__NR_setuid, x0); FAIL;
|
|
Mark Wielaard |
e4df76 |
+ SY(__NR_setuid, x0-1); FAIL;
|
|
Mark Wielaard |
e4df76 |
|
|
Mark Wielaard |
e4df76 |
// __NR_getuid 24
|
|
Mark Wielaard |
e4df76 |
GO(__NR_getuid, "0s 0m");
|
|
Mark Wielaard |
e4df76 |
@@ -229,7 +229,7 @@ int main(void)
|
|
Mark Wielaard |
e4df76 |
|
|
Mark Wielaard |
e4df76 |
// __NR_setgid 46
|
|
Mark Wielaard |
e4df76 |
GO(__NR_setgid, "1s 0m");
|
|
Mark Wielaard |
e4df76 |
- SY(__NR_setgid, x0); FAIL;
|
|
Mark Wielaard |
e4df76 |
+ SY(__NR_setgid, x0-1); FAIL;
|
|
Mark Wielaard |
e4df76 |
|
|
Mark Wielaard |
e4df76 |
// __NR_getgid 47
|
|
Mark Wielaard |
e4df76 |
GO(__NR_getgid, "0s 0m");
|
|
Mark Wielaard |
e4df76 |
@@ -249,7 +249,7 @@ int main(void)
|
|
Mark Wielaard |
e4df76 |
|
|
Mark Wielaard |
e4df76 |
// __NR_acct 51
|
|
Mark Wielaard |
e4df76 |
GO(__NR_acct, "1s 1m");
|
|
Mark Wielaard |
e4df76 |
- SY(__NR_acct, x0); FAIL;
|
|
Mark Wielaard |
e4df76 |
+ SY(__NR_acct, x0-1); FAIL;
|
|
Mark Wielaard |
e4df76 |
|
|
Mark Wielaard |
e4df76 |
// __NR_umount2 52
|
|
Mark Wielaard |
e4df76 |
GO(__NR_umount2, "2s 1m");
|
|
Mark Wielaard |
e4df76 |
@@ -340,11 +340,11 @@ int main(void)
|
|
Mark Wielaard |
e4df76 |
|
|
Mark Wielaard |
e4df76 |
// __NR_setreuid 70
|
|
Mark Wielaard |
e4df76 |
GO(__NR_setreuid, "2s 0m");
|
|
Mark Wielaard |
e4df76 |
- SY(__NR_setreuid, x0, x0); FAIL;
|
|
Mark Wielaard |
e4df76 |
+ SY(__NR_setreuid, x0-1, x0-1); SUCC;
|
|
Mark Wielaard |
e4df76 |
|
|
Mark Wielaard |
e4df76 |
// __NR_setregid 71
|
|
Mark Wielaard |
e4df76 |
GO(__NR_setregid, "2s 0m");
|
|
Mark Wielaard |
e4df76 |
- SY(__NR_setregid, x0, x0); FAIL;
|
|
Mark Wielaard |
e4df76 |
+ SY(__NR_setregid, x0-1, x0-1); SUCC;
|
|
Mark Wielaard |
e4df76 |
|
|
Mark Wielaard |
e4df76 |
// __NR_sigsuspend arm64 only has rt_sigsuspend
|
|
Mark Wielaard |
e4df76 |
// XXX: how do you use this function?
|
|
Mark Wielaard |
e4df76 |
@@ -447,7 +447,7 @@ int main(void)
|
|
Mark Wielaard |
e4df76 |
|
|
Mark Wielaard |
e4df76 |
// __NR_fchown 95
|
|
Mark Wielaard |
e4df76 |
GO(__NR_fchown, "3s 0m");
|
|
Mark Wielaard |
e4df76 |
- SY(__NR_fchown, x0, x0, x0); FAIL;
|
|
Mark Wielaard |
e4df76 |
+ SY(__NR_fchown, x0-1, x0, x0); FAIL;
|
|
Mark Wielaard |
e4df76 |
|
|
Mark Wielaard |
e4df76 |
// __NR_getpriority 96
|
|
Mark Wielaard |
e4df76 |
GO(__NR_getpriority, "2s 0m");
|
|
Mark Wielaard |
e4df76 |
@@ -733,7 +733,7 @@ int main(void)
|
|
Mark Wielaard |
e4df76 |
|
|
Mark Wielaard |
e4df76 |
// __NR_setresuid 164
|
|
Mark Wielaard |
e4df76 |
GO(__NR_setresuid, "3s 0m");
|
|
Mark Wielaard |
e4df76 |
- SY(__NR_setresuid, x0, x0, x0); FAIL;
|
|
Mark Wielaard |
e4df76 |
+ SY(__NR_setresuid, x0-1, x0-1, x0-1); SUCC;
|
|
Mark Wielaard |
e4df76 |
|
|
Mark Wielaard |
e4df76 |
// __NR_getresuid 165
|
|
Mark Wielaard |
e4df76 |
GO(__NR_getresuid, "3s 3m");
|
|
Mark Wielaard |
e4df76 |
@@ -757,7 +757,7 @@ int main(void)
|
|
Mark Wielaard |
e4df76 |
|
|
Mark Wielaard |
e4df76 |
// __NR_setresgid 170
|
|
Mark Wielaard |
e4df76 |
GO(__NR_setresgid, "3s 0m");
|
|
Mark Wielaard |
e4df76 |
- SY(__NR_setresgid, x0, x0, x0); FAIL;
|
|
Mark Wielaard |
e4df76 |
+ SY(__NR_setresgid, x0-1, x0-1, x0-1); SUCC;
|
|
Mark Wielaard |
e4df76 |
|
|
Mark Wielaard |
e4df76 |
// __NR_getresgid 171
|
|
Mark Wielaard |
e4df76 |
GO(__NR_getresgid, "3s 3m");
|