seccomp: fix blocking of process spawning
commit5a2f693f07a1e93ada5277b2fb1530b2698be0fa
authorDaniel P. Berrangé <berrange@redhat.com>
Thu, 29 Jul 2021 12:32:37 +0000 (29 13:32 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Wed, 16 Feb 2022 18:52:40 +0000 (16 18:52 +0000)
tree9f5c4a900665ecc50e45c18bd00d2405c9183a57
parentd2ea8dac705fe9bca9b6b26a7aeb063d1a406f7a
seccomp: fix blocking of process spawning

When '-sandbox on,spawn=deny' is given, we are supposed to block the
ability to spawn processes. We naively blocked the 'fork' syscall,
forgetting that any modern libc will use the 'clone' syscall instead.

We can't simply block the 'clone' syscall though, as that will break
thread creation. We thus list the set of flags used to create threads
and block anything that doesn't match this exactly.

Acked-by: Eduardo Otubo <otubo@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
softmmu/qemu-seccomp.c
tests/unit/test-seccomp.c