aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/seccomp/test_harness.h
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2015-08-21 11:22:35 -0700
committerShuah Khan <shuahkh@osg.samsung.com>2015-09-14 16:41:37 -0600
commitb623c4daadb5a4bfaef62783085b95bd9ba5a77c (patch)
treeffe99d71c008aeb7adedc79a2848954cd432c9a5 /tools/testing/selftests/seccomp/test_harness.h
parentseltests/zram: fix syntax error (diff)
downloadlinux-dev-b623c4daadb5a4bfaef62783085b95bd9ba5a77c.tar.xz
linux-dev-b623c4daadb5a4bfaef62783085b95bd9ba5a77c.zip
selftests/seccomp: add support for s390
This adds support for s390 to the seccomp selftests. Some improvements were made to enhance the accuracy of failure reporting, and additional tests were added to validate assumptions about the currently traced syscall. Also adds early asserts for running on older kernels to avoid noise when the seccomp syscall is not implemented. Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Diffstat (limited to '')
-rw-r--r--tools/testing/selftests/seccomp/test_harness.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/tools/testing/selftests/seccomp/test_harness.h b/tools/testing/selftests/seccomp/test_harness.h
index 977a6afc4489..fb2841601f2f 100644
--- a/tools/testing/selftests/seccomp/test_harness.h
+++ b/tools/testing/selftests/seccomp/test_harness.h
@@ -370,11 +370,8 @@
__typeof__(_expected) __exp = (_expected); \
__typeof__(_seen) __seen = (_seen); \
if (!(__exp _t __seen)) { \
- unsigned long long __exp_print = 0; \
- unsigned long long __seen_print = 0; \
- /* Avoid casting complaints the scariest way we can. */ \
- memcpy(&__exp_print, &__exp, sizeof(__exp)); \
- memcpy(&__seen_print, &__seen, sizeof(__seen)); \
+ unsigned long long __exp_print = (unsigned long long)__exp; \
+ unsigned long long __seen_print = (unsigned long long)__seen; \
__TH_LOG("Expected %s (%llu) %s %s (%llu)", \
#_expected, __exp_print, #_t, \
#_seen, __seen_print); \