From patchwork Mon Nov 16 09:09:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Otubo X-Patchwork-Id: 56689 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1576891lbb; Mon, 16 Nov 2015 14:01:50 -0800 (PST) X-Received: by 10.31.132.197 with SMTP id g188mr142263vkd.96.1447711310873; Mon, 16 Nov 2015 14:01:50 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [208.118.235.17]) by mx.google.com with ESMTPS id v68si127639vkd.25.2015.11.16.14.01.50 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 16 Nov 2015 14:01:50 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dkim=fail header.i=@profitbricks_com.20150623.gappssmtp.com Received: from localhost ([::1]:50354 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyRqQ-0000aV-Eh for patch@linaro.org; Mon, 16 Nov 2015 17:01:50 -0500 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=profitbricks_com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7uCFOUmhDqYSmZgxm6aukgTYAba2GU6alMR3gNZhheg=; b=AodsKUelP+N/CG+2inuh1q5U2F8I2OQ91gaEqnD9dfQOktBHJmddTPN8wk8S08JEGm rl6NImHqPpV5F264ps8Hd27p8mydz/XksPgITtVt1PDAdLiCyhpG2FTFhOrb7P0VUl5C ah+A1A+GQIB6lx3XNttWUGV2eeBVZDluLojFICvLxFBebVSzLQ+YqFN2YXA/vnD7+s95 Rah2LomlLtu+9SL4thPevSzpwhD3N5vrLXO7hj02Jcgkg9dbjJDMoHgYfYAkud13sLQA /7xfPlHvzyHjkX9dR0keqSrU/StPIgATRPLRDACJyBtFlJm2AuPg+ldsWm3wEwVoRloX T85w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7uCFOUmhDqYSmZgxm6aukgTYAba2GU6alMR3gNZhheg=; b=Miw9oPTTrfgoPHPxTC/D+1IPs65BMWGE9NxHX8QmMoHEzY/63spNULc1ZglT4PZOrR BRwrBruBJMBCptAli9mph7A4v4gyuCCCcVg1lVIK1eXyQXEStYsPMf1+F0rMzS58aMVj QRMYW6FLOfcog+bn6lwpnSzUIn0fDb/+7rKVL1WtH1R5KEW4vSJpnMs1JvmC01boP7DK QcG2aUu1fQfJcrMiSW8AB3R+2rscZCnKCRYXuJec1nF6T2SO0QhiBcIiAwb8i/D2f2pE n8XKIx0lNr7dkCe6zi9hhHtLcANo6YjIxmAV7LOwmSVhJZNPOwsEFj7R1Cm2ZoXLSkkm LrtA== X-Gm-Message-State: ALoCoQmcdSIawcNXvZee59DBYMkxyv81ILA9WthLZ1KLPE21pL278ilfZ0OAbxvmrOGQpkK8noke X-Received: by 10.28.139.143 with SMTP id n137mr16542655wmd.8.1447664957703; Mon, 16 Nov 2015 01:09:17 -0800 (PST) Received: from vader.pb.local ([62.217.45.26]) by smtp.gmail.com with ESMTPSA id d66sm17449709wma.21.2015.11.16.01.09.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Nov 2015 01:09:17 -0800 (PST) From: Eduardo Otubo To: qemu-devel@nongnu.org Date: Mon, 16 Nov 2015 10:09:05 +0100 Message-Id: <1447664947-31044-2-git-send-email-eduardo.otubo@profitbricks.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1447664947-31044-1-git-send-email-eduardo.otubo@profitbricks.com> References: <1447664947-31044-1-git-send-email-eduardo.otubo@profitbricks.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c09::236 Cc: peter.maydell@linaro.org, drjones@redhat.com, dann.frazier@canonical.com Subject: [Qemu-devel] [PULL 01/03] seccomp: add cacheflush to whitelist X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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(-) -- 2.1.4 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)