]> granicus.if.org Git - strace/commitdiff
tests: skip seccomp-strict.test and prctl-seccomp-strict.test on x32
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 12 Apr 2016 04:39:25 +0000 (04:39 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 12 Apr 2016 04:39:25 +0000 (04:39 +0000)
As x86_64 kernel does not support x32 syscall numbers in
SECCOMP_MODE_STRICT, skip affected tests on x32.

* tests/seccomp-strict.c (main) [__x86_64__ && __ILP32__]: Bail out
using error_msg_and_skip.
* tests/prctl-seccomp-strict.c: Likewise.

tests/prctl-seccomp-strict.c
tests/seccomp-strict.c

index 22db394989b3e4c9e1867609f38695af77a8aa0d..0a0d6a8ccb7f3cf93d4e7b8daf0890b3f94d2ef9 100644 (file)
 int
 main(void)
 {
+# if defined __x86_64__ && defined __ILP32__
+       /*
+        * Syscall numbers are hardcoded in
+        * kernel/seccomp.c:__secure_computing_strict(),
+        * but x32 syscall numbers are not supported.
+        */
+       error_msg_and_skip("SECCOMP_MODE_STRICT is not supported on x32");
+# else
        static const char text1[] =
                "prctl(PR_SET_SECCOMP, SECCOMP_MODE_STRICT) = 0\n";
        static const char text2[] = "+++ exited with 0 +++\n";
@@ -61,6 +69,7 @@ main(void)
 
        rc += write(1, text2, LENGTH_OF(text2)) != LENGTH_OF(text2);
        return !!syscall(__NR_exit, rc);
+# endif
 }
 
 #else
index 348bd2ebe6855e0b5c11cea1c39d37cfe0f9d0e8..f9fef96dec048040774119bd978c47d2d47f9e06 100644 (file)
 int
 main(void)
 {
+# if defined __x86_64__ && defined __ILP32__
+       /*
+        * Syscall numbers are hardcoded in
+        * kernel/seccomp.c:__secure_computing_strict(),
+        * but x32 syscall numbers are not supported.
+        */
+       error_msg_and_skip("SECCOMP_SET_MODE_STRICT is not supported on x32");
+# else
        static const char text1[] =
                "seccomp(SECCOMP_SET_MODE_STRICT, 0, NULL) = 0\n";
        static const char text2[] = "+++ exited with 0 +++\n";
@@ -61,6 +69,7 @@ main(void)
 
        rc += write(1, text2, LENGTH_OF(text2)) != LENGTH_OF(text2);
        return !!syscall(__NR_exit, rc);
+# endif
 }
 
 #else