tests: skip seccomp-strict.test and prctl-seccomp-strict.test on x32
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.
This commit is contained in:
parent
c2523e0d9c
commit
9c1a72cd3f
@ -41,6 +41,14 @@
|
||||
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
|
||||
|
@ -40,6 +40,14 @@
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user