]> git.proxmox.com Git - mirror_qemu.git/commit - tests/unit/test-seccomp.c
seccomp: add unit test for seccomp filtering
authorDaniel P. Berrangé <berrange@redhat.com>
Thu, 29 Jul 2021 12:15:43 +0000 (13:15 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Wed, 16 Feb 2022 18:52:40 +0000 (18:52 +0000)
commitd2ea8dac705fe9bca9b6b26a7aeb063d1a406f7a
tree41563216a16a629fe69ba4bc891e385828cb272c
parent8f46f56260cb7eaf1bcc77366c8ce69af9bd5bec
seccomp: add unit test for seccomp filtering

The handling of some syscalls / libc function is quite subtle. For
example, 'fork' at a libc level doesn't always correspond to 'fork'
at a syscall level, since the 'clone' syscall is preferred usually.

The unit test will help to detect these kind of problems. A point of
difficulty in writing a test though is that the QEMU build process may
already be confined by seccomp. For example, if running inside a
container. Since we can't predict what filtering might have been applied
already, we are quite conservative and skip all tests if we see any kind
of seccomp filter active.

Acked-by: Eduardo Otubo <otubo@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
MAINTAINERS
tests/unit/meson.build
tests/unit/test-seccomp.c [new file with mode: 0644]