From: Marc-André Lureau Date: Wed, 22 Aug 2018 17:02:47 +0000 (+0200) Subject: seccomp: use SIGSYS signal instead of killing the thread X-Git-Tag: v3.0.1~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8eba63e1d246b2a40a96519951d4079a806e1b27;p=thirdparty%2Fqemu.git seccomp: use SIGSYS signal instead of killing the thread The seccomp action SCMP_ACT_KILL results in immediate termination of the thread that made the bad system call. However, qemu being multi-threaded, it keeps running. There is no easy way for parent process / management layer (libvirt) to know about that situation. Instead, the default SIGSYS handler when invoked with SCMP_ACT_TRAP will terminate the program and core dump. This may not be the most secure solution, but probably better than just killing the offending thread. SCMP_ACT_KILL_PROCESS has been added in Linux 4.14 to improve the situation, which I propose to use by default if available in the next patch. Related to: https://bugzilla.redhat.com/show_bug.cgi?id=1594456 Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé Acked-by: Eduardo Otubo (cherry picked from commit 6f2231e9b0931e1998d9ed0c509adf7aedc02db2) *CVE-2018-15746 Signed-off-by: Michael Roth --- diff --git a/qemu-seccomp.c b/qemu-seccomp.c index 9cd8eb94998..b117a925595 100644 --- a/qemu-seccomp.c +++ b/qemu-seccomp.c @@ -125,7 +125,7 @@ static int seccomp_start(uint32_t seccomp_opts) continue; } - rc = seccomp_rule_add_array(ctx, SCMP_ACT_KILL, blacklist[i].num, + rc = seccomp_rule_add_array(ctx, SCMP_ACT_TRAP, blacklist[i].num, blacklist[i].narg, blacklist[i].arg_cmp); if (rc < 0) { goto seccomp_return;