Blame SOURCES/valgrind-3.15.0-scalar-arm64.patch

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