seccomp: block use of clone3 syscall
commitc542b302707628609f2a33bcbd3e442282806b8e
authorDaniel P. Berrangé <berrange@redhat.com>
Thu, 29 Jul 2021 15:43:01 +0000 (29 16:43 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Wed, 16 Feb 2022 18:52:40 +0000 (16 18:52 +0000)
treeb13b0a396f4a7cc8d7ed5e05cbfb0b6dfc115927
parent5a2f693f07a1e93ada5277b2fb1530b2698be0fa
seccomp: block use of clone3 syscall

Modern glibc will use clone3 instead of clone, when it detects that it
is available. We need to compare flags in order to decide whether to
allow clone (thread create vs process fork), but in clone3 the flags
are hidden inside a struct. Seccomp can't currently match on data inside
a struct, so our only option is to block clone3 entirely. If we use
ENOSYS to block it, then glibc transparently falls back to clone.

This may need to be revisited if Linux adds a new architecture in
future and only provides clone3, without clone.

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