]> git.proxmox.com Git - mirror_libseccomp.git/commit - tests/.gitignore
tests: add a test for faulty handling of the x32 architecture
authorMathias Krause' via libseccomp <libseccomp@googlegroups.com>
Sun, 14 Jun 2015 09:09:15 +0000 (11:09 +0200)
committerPaul Moore <pmoore@redhat.com>
Mon, 15 Jun 2015 21:31:08 +0000 (17:31 -0400)
commit25be15a99463286f1dcf8ba581ad9b94676db754
tree9cece06916ffb0172a935d6a0ac6ce183b6e415c
parent9b16b91c1293c3629529d288018415e309043daa
tests: add a test for faulty handling of the x32 architecture

We currently allow calling close() on the x32 architecture when we're
generating a blacklist filter for x86 and x86_64, i.e. one with an
ALLOW policy. We shouldn't as the default handling for unsupported
architectures should be defined by the bad_arch handling -- not the
default policy.

The reason for the faulty behaviour is the wrong jump target for the
x32 architecture test. It should jump to the KILL label, not the next
architecture test instruction. That one won't test the architecture
any more as the accumulator register was already overwritten with the
syscall number for the x32 test.

This test generates a filter that should return ERRNO(1) on calls to
close() for supported architectures or KILL on unsupported ones. But,
currently, does not do so for x32 and ALLOWs the syscall instead.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
[PM: added a python version of the test]
Signed-off-by: Paul Moore <pmoore@redhat.com>
tests/.gitignore
tests/28-sim-arch_x86.c [new file with mode: 0644]
tests/28-sim-arch_x86.py [new file with mode: 0644]
tests/28-sim-arch_x86.tests [new file with mode: 0644]
tests/Makefile.am