Received: from eggs.gnu.org ([2001:4830:134:3::10]:38079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyFmt-0006Ut-1S for qemu-devel@nongnu.org; Mon, 16 Nov 2015 04:09:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZyFmo-0000H2-HF for qemu-devel@nongnu.org; Mon, 16 Nov 2015 04:09:22 -0500 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]:36246) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyFmo-0000Gn-Ag for qemu-devel@nongnu.org; Mon, 16 Nov 2015 04:09:18 -0500 Received: by wmww144 with SMTP id w144so100730615wmw.1 for ; Mon, 16 Nov 2015 01:09:17 -0800 (PST) From: Eduardo Otubo Date: Mon, 16 Nov 2015 10:09:05 +0100 Message-Id: <1447664947-31044-2-git-send-email-eduardo.otubo@profitbricks.com> In-Reply-To: <1447664947-31044-1-git-send-email-eduardo.otubo@profitbricks.com> References: <1447664947-31044-1-git-send-email-eduardo.otubo@profitbricks.com> Subject: [Qemu-devel] [PULL 01/03] seccomp: add cacheflush to whitelist List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, drjones@redhat.com, dann.frazier@canonical.com From: Andrew Jones cacheflush is an arm-specific syscall that qemu built for arm uses. Add it to the whitelist, but only if we're linking with a recent enough libseccomp. Signed-off-by: Andrew Jones Acked-by: Eduardo Otubo --- qemu-seccomp.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/qemu-seccomp.c b/qemu-seccomp.c index 80d034a..c831fe8 100644 --- a/qemu-seccomp.c +++ b/qemu-seccomp.c @@ -16,6 +16,14 @@ #include #include "sysemu/seccomp.h" +#if SCMP_VER_MAJOR >= 3 + #define HAVE_CACHEFLUSH +#elif SCMP_VER_MAJOR == 2 && SCMP_VER_MINOR >= 3 + #define HAVE_CACHEFLUSH +#elif SCMP_VER_MAJOR == 2 && SCMP_VER_MINOR == 2 && SCMP_VER_MICRO >= 3 + #define HAVE_CACHEFLUSH +#endif + struct QemuSeccompSyscall { int32_t num; uint8_t priority; @@ -238,7 +246,10 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = { { SCMP_SYS(inotify_init1), 240 }, { SCMP_SYS(inotify_add_watch), 240 }, { SCMP_SYS(mbind), 240 }, - { SCMP_SYS(memfd_create), 240 } + { SCMP_SYS(memfd_create), 240 }, +#ifdef HAVE_CACHEFLUSH + { SCMP_SYS(cacheflush), 240 }, +#endif }; int seccomp_start(void) -- 2.1.4