|
Mark Wielaard |
9864b2 |
commit abc09f23e1ad55a07beb827aef969acfe6c496ef
|
|
Mark Wielaard |
9864b2 |
Author: Mark Wielaard <mark@klomp.org>
|
|
Mark Wielaard |
9864b2 |
Date: Mon May 20 13:08:41 2019 +0200
|
|
Mark Wielaard |
9864b2 |
|
|
Mark Wielaard |
9864b2 |
Make memcheck/tests/x86-linux/scalar test work under root.
|
|
Mark Wielaard |
9864b2 |
|
|
Mark Wielaard |
9864b2 |
Running the testsuite as root isn't really recommended.
|
|
Mark Wielaard |
9864b2 |
But lets not make tests fail unnecessarily when running as root.
|
|
Mark Wielaard |
9864b2 |
Similar to the arm64-linux/scalar fixes. Plus 32bit variants that
|
|
Mark Wielaard |
9864b2 |
don't exist on arm64.
|
|
Mark Wielaard |
9864b2 |
|
|
Mark Wielaard |
9864b2 |
Pass really invalid arguments to setuid[32], setgid[32], acct, fchown[32].
|
|
Mark Wielaard |
9864b2 |
Make setresgid[32], setresuid[32], setregid[32], setreuid[32] always succeed.
|
|
Mark Wielaard |
9864b2 |
|
|
Mark Wielaard |
9864b2 |
diff --git a/memcheck/tests/x86-linux/scalar.c b/memcheck/tests/x86-linux/scalar.c
|
|
Mark Wielaard |
9864b2 |
index 213a5ad..52f0d4e 100644
|
|
Mark Wielaard |
9864b2 |
--- a/memcheck/tests/x86-linux/scalar.c
|
|
Mark Wielaard |
9864b2 |
+++ b/memcheck/tests/x86-linux/scalar.c
|
|
Mark Wielaard |
9864b2 |
@@ -145,7 +145,7 @@ int main(void)
|
|
Mark Wielaard |
9864b2 |
|
|
Mark Wielaard |
9864b2 |
// __NR_setuid 23
|
|
Mark Wielaard |
9864b2 |
GO(__NR_setuid, "1s 0m");
|
|
Mark Wielaard |
9864b2 |
- SY(__NR_setuid, x0); FAIL;
|
|
Mark Wielaard |
9864b2 |
+ SY(__NR_setuid, x0-1); FAIL;
|
|
Mark Wielaard |
9864b2 |
|
|
Mark Wielaard |
9864b2 |
// __NR_getuid 24
|
|
Mark Wielaard |
9864b2 |
GO(__NR_getuid, "0s 0m");
|
|
Mark Wielaard |
9864b2 |
@@ -238,7 +238,7 @@ int main(void)
|
|
Mark Wielaard |
9864b2 |
|
|
Mark Wielaard |
9864b2 |
// __NR_setgid 46
|
|
Mark Wielaard |
9864b2 |
GO(__NR_setgid, "1s 0m");
|
|
Mark Wielaard |
9864b2 |
- SY(__NR_setgid, x0); FAIL;
|
|
Mark Wielaard |
9864b2 |
+ SY(__NR_setgid, x0-1); FAIL;
|
|
Mark Wielaard |
9864b2 |
|
|
Mark Wielaard |
9864b2 |
// __NR_getgid 47
|
|
Mark Wielaard |
9864b2 |
GO(__NR_getgid, "0s 0m");
|
|
Mark Wielaard |
9864b2 |
@@ -258,7 +258,7 @@ int main(void)
|
|
Mark Wielaard |
9864b2 |
|
|
Mark Wielaard |
9864b2 |
// __NR_acct 51
|
|
Mark Wielaard |
9864b2 |
GO(__NR_acct, "1s 1m");
|
|
Mark Wielaard |
9864b2 |
- SY(__NR_acct, x0); FAIL;
|
|
Mark Wielaard |
9864b2 |
+ SY(__NR_acct, x0-1); FAIL;
|
|
Mark Wielaard |
9864b2 |
|
|
Mark Wielaard |
9864b2 |
// __NR_umount2 52
|
|
Mark Wielaard |
9864b2 |
GO(__NR_umount2, "2s 1m");
|
|
Mark Wielaard |
9864b2 |
@@ -349,11 +349,11 @@ int main(void)
|
|
Mark Wielaard |
9864b2 |
|
|
Mark Wielaard |
9864b2 |
// __NR_setreuid 70
|
|
Mark Wielaard |
9864b2 |
GO(__NR_setreuid, "2s 0m");
|
|
Mark Wielaard |
9864b2 |
- SY(__NR_setreuid, x0, x0); FAIL;
|
|
Mark Wielaard |
9864b2 |
+ SY(__NR_setreuid, x0-1, x0-1); SUCC;
|
|
Mark Wielaard |
9864b2 |
|
|
Mark Wielaard |
9864b2 |
// __NR_setregid 71
|
|
Mark Wielaard |
9864b2 |
GO(__NR_setregid, "2s 0m");
|
|
Mark Wielaard |
9864b2 |
- SY(__NR_setregid, x0, x0); FAIL;
|
|
Mark Wielaard |
9864b2 |
+ SY(__NR_setregid, x0-1, x0-1); SUCC;
|
|
Mark Wielaard |
9864b2 |
|
|
Mark Wielaard |
9864b2 |
// __NR_sigsuspend 72
|
|
Mark Wielaard |
9864b2 |
// XXX: how do you use this function?
|
|
Mark Wielaard |
9864b2 |
@@ -456,7 +456,7 @@ int main(void)
|
|
Mark Wielaard |
9864b2 |
|
|
Mark Wielaard |
9864b2 |
// __NR_fchown 95
|
|
Mark Wielaard |
9864b2 |
GO(__NR_fchown, "3s 0m");
|
|
Mark Wielaard |
9864b2 |
- SY(__NR_fchown, x0, x0, x0); FAIL;
|
|
Mark Wielaard |
9864b2 |
+ SY(__NR_fchown, x0-1, x0, x0); FAIL;
|
|
Mark Wielaard |
9864b2 |
|
|
Mark Wielaard |
9864b2 |
// __NR_getpriority 96
|
|
Mark Wielaard |
9864b2 |
GO(__NR_getpriority, "2s 0m");
|
|
Mark Wielaard |
9864b2 |
@@ -742,7 +742,7 @@ int main(void)
|
|
Mark Wielaard |
9864b2 |
|
|
Mark Wielaard |
9864b2 |
// __NR_setresuid 164
|
|
Mark Wielaard |
9864b2 |
GO(__NR_setresuid, "3s 0m");
|
|
Mark Wielaard |
9864b2 |
- SY(__NR_setresuid, x0, x0, x0); FAIL;
|
|
Mark Wielaard |
9864b2 |
+ SY(__NR_setresuid, x0-1, x0-1, x0-1); SUCC;
|
|
Mark Wielaard |
9864b2 |
|
|
Mark Wielaard |
9864b2 |
// __NR_getresuid 165
|
|
Mark Wielaard |
9864b2 |
GO(__NR_getresuid, "3s 3m");
|
|
Mark Wielaard |
9864b2 |
@@ -766,7 +766,7 @@ int main(void)
|
|
Mark Wielaard |
9864b2 |
|
|
Mark Wielaard |
9864b2 |
// __NR_setresgid 170
|
|
Mark Wielaard |
9864b2 |
GO(__NR_setresgid, "3s 0m");
|
|
Mark Wielaard |
9864b2 |
- SY(__NR_setresgid, x0, x0, x0); FAIL;
|
|
Mark Wielaard |
9864b2 |
+ SY(__NR_setresgid, x0-1, x0-1, x0-1); SUCC;
|
|
Mark Wielaard |
9864b2 |
|
|
Mark Wielaard |
9864b2 |
// __NR_getresgid 171
|
|
Mark Wielaard |
9864b2 |
GO(__NR_getresgid, "3s 3m");
|
|
Mark Wielaard |
9864b2 |
@@ -923,11 +923,11 @@ int main(void)
|
|
Mark Wielaard |
9864b2 |
|
|
Mark Wielaard |
9864b2 |
// __NR_setreuid32 203
|
|
Mark Wielaard |
9864b2 |
GO(__NR_setreuid32, "2s 0m");
|
|
Mark Wielaard |
9864b2 |
- SY(__NR_setreuid32, x0, x0); FAIL;
|
|
Mark Wielaard |
9864b2 |
+ SY(__NR_setreuid32, x0-1, x0-1); SUCC;
|
|
Mark Wielaard |
9864b2 |
|
|
Mark Wielaard |
9864b2 |
// __NR_setregid32 204
|
|
Mark Wielaard |
9864b2 |
GO(__NR_setregid32, "2s 0m");
|
|
Mark Wielaard |
9864b2 |
- SY(__NR_setregid32, x0, x0); FAIL;
|
|
Mark Wielaard |
9864b2 |
+ SY(__NR_setregid32, x0-1, x0-1); SUCC;
|
|
Mark Wielaard |
9864b2 |
|
|
Mark Wielaard |
9864b2 |
// __NR_getgroups32 205
|
|
Mark Wielaard |
9864b2 |
GO(__NR_getgroups32, "2s 1m");
|
|
Mark Wielaard |
9864b2 |
@@ -939,11 +939,11 @@ int main(void)
|
|
Mark Wielaard |
9864b2 |
|
|
Mark Wielaard |
9864b2 |
// __NR_fchown32 207
|
|
Mark Wielaard |
9864b2 |
GO(__NR_fchown32, "3s 0m");
|
|
Mark Wielaard |
9864b2 |
- SY(__NR_fchown32, x0, x0, x0); FAIL;
|
|
Mark Wielaard |
9864b2 |
+ SY(__NR_fchown32, x0-1, x0, x0); FAIL;
|
|
Mark Wielaard |
9864b2 |
|
|
Mark Wielaard |
9864b2 |
// __NR_setresuid32 208
|
|
Mark Wielaard |
9864b2 |
GO(__NR_setresuid32, "3s 0m");
|
|
Mark Wielaard |
9864b2 |
- SY(__NR_setresuid32, x0, x0, x0); FAIL;
|
|
Mark Wielaard |
9864b2 |
+ SY(__NR_setresuid32, x0-1, x0-1, x0-1); SUCC;
|
|
Mark Wielaard |
9864b2 |
|
|
Mark Wielaard |
9864b2 |
// __NR_getresuid32 209
|
|
Mark Wielaard |
9864b2 |
GO(__NR_getresuid32, "3s 3m");
|
|
Mark Wielaard |
9864b2 |
@@ -951,7 +951,7 @@ int main(void)
|
|
Mark Wielaard |
9864b2 |
|
|
Mark Wielaard |
9864b2 |
// __NR_setresgid32 210
|
|
Mark Wielaard |
9864b2 |
GO(__NR_setresgid32, "3s 0m");
|
|
Mark Wielaard |
9864b2 |
- SY(__NR_setresgid32, x0, x0, x0); FAIL;
|
|
Mark Wielaard |
9864b2 |
+ SY(__NR_setresgid32, x0-1, x0-1, x0-1); SUCC;
|
|
Mark Wielaard |
9864b2 |
|
|
Mark Wielaard |
9864b2 |
// __NR_getresgid32 211
|
|
Mark Wielaard |
9864b2 |
GO(__NR_getresgid32, "3s 3m");
|
|
Mark Wielaard |
9864b2 |
@@ -963,11 +963,11 @@ int main(void)
|
|
Mark Wielaard |
9864b2 |
|
|
Mark Wielaard |
9864b2 |
// __NR_setuid32 213
|
|
Mark Wielaard |
9864b2 |
GO(__NR_setuid32, "1s 0m");
|
|
Mark Wielaard |
9864b2 |
- SY(__NR_setuid32, x0); FAIL;
|
|
Mark Wielaard |
9864b2 |
+ SY(__NR_setuid32, x0-1); FAIL;
|
|
Mark Wielaard |
9864b2 |
|
|
Mark Wielaard |
9864b2 |
// __NR_setgid32 214
|
|
Mark Wielaard |
9864b2 |
GO(__NR_setgid32, "1s 0m");
|
|
Mark Wielaard |
9864b2 |
- SY(__NR_setgid32, x0); FAIL;
|
|
Mark Wielaard |
9864b2 |
+ SY(__NR_setgid32, x0-1); FAIL;
|
|
Mark Wielaard |
9864b2 |
|
|
Mark Wielaard |
9864b2 |
// __NR_setfsuid32 215
|
|
Mark Wielaard |
9864b2 |
GO(__NR_setfsuid32, "1s 0m");
|