summaryrefslogtreecommitdiff
path: root/tests/48-sim-32b_args.tests
diff options
context:
space:
mode:
authorPaul Moore <paul@paul-moore.com>2019-01-14 22:33:44 -0500
committerPaul Moore <paul@paul-moore.com>2019-02-21 20:57:42 -0500
commit80a987d6f8d0152def07fa90ace6417d56eea741 (patch)
treefc823a59b36de7f48092cddac1b160cb3f989db9 /tests/48-sim-32b_args.tests
parentbd42d36c9b9f4e892a1d30c192dcbd11a5b7f1dd (diff)
downloadlibseccomp-80a987d6f8d0152def07fa90ace6417d56eea741.tar.gz
api: provide 32-bit friendly argument comparison macros
We have a longstanding issue with 32-bit to 64-bit sign extension inadvertently resulting in bogus syscall argument extensions. This patch introduces a new set of argument comparison macros which limit the argument values to 32-bit values so that we don't run into problems with sign extension. We use the macro overloading proposed by Roman at https://kecher.net/overloading-macros/ to retain the feature of these macros being usable as static initializers. Thanks to @jdstrand on GitHub for reporting the problem. Signed-off-by: Paul Moore <paul@paul-moore.com> Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
Diffstat (limited to 'tests/48-sim-32b_args.tests')
-rw-r--r--tests/48-sim-32b_args.tests38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/48-sim-32b_args.tests b/tests/48-sim-32b_args.tests
new file mode 100644
index 0000000..b19fe5e
--- /dev/null
+++ b/tests/48-sim-32b_args.tests
@@ -0,0 +1,38 @@
+#
+# libseccomp regression test automation data
+#
+# Copyright (c) 2019 Cisco Systems, Inc. <pmoore2@cisco.com>
+# Author: Paul Moore <paul@paul-moore.com>
+#
+
+test type: bpf-sim
+
+# Testname Arch Syscall Arg0 Arg1 Arg2 Arg3 Arg4 Arg5 Result
+48-sim-32b_args all 1000 0x0 N N N N N KILL
+48-sim-32b_args all 1000 0xffffffff N N N N N KILL
+48-sim-32b_args all 1000 0xffffffffffffffff N N N N N ALLOW
+48-sim-32b_args all 1032 0x0 N N N N N KILL
+48-sim-32b_args all 1032 0xffffffff N N N N N ALLOW
+48-sim-32b_args all 1032 0xffffffffffffffff N N N N N KILL
+48-sim-32b_args all 1064 0x0 N N N N N KILL
+48-sim-32b_args all 1064 0xffffffff N N N N N KILL
+48-sim-32b_args all 1064 0xffffffffffffffff N N N N N ALLOW
+48-sim-32b_args all 2000 0x0 N N N N N KILL
+48-sim-32b_args all 2000 0xffffffff N N N N N KILL
+48-sim-32b_args all 2000 0xffffffffffffffff N N N N N ALLOW
+48-sim-32b_args all 2032 0x0 N N N N N KILL
+48-sim-32b_args all 2032 0xffffffff N N N N N ALLOW
+48-sim-32b_args all 2032 0xffffffffffffffff N N N N N KILL
+48-sim-32b_args all 2064 0x0 N N N N N KILL
+48-sim-32b_args all 2064 0xffffffff N N N N N KILL
+48-sim-32b_args all 2064 0xffffffffffffffff N N N N N ALLOW
+
+test type: bpf-sim-fuzz
+
+# Testname StressCount
+48-sim-32b_args 50
+
+test type: bpf-valgrind
+
+# Testname
+48-sim-32b_args