From patchwork Fri Apr 8 13:16:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hogan X-Patchwork-Id: 8783601 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 103E2C0553 for ; Fri, 8 Apr 2016 13:17:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 71823202DD for ; Fri, 8 Apr 2016 13:17:29 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 69EBC202BE for ; Fri, 8 Apr 2016 13:17:28 +0000 (UTC) Received: from localhost ([::1]:56197 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aoWHv-0004rd-PL for patchwork-qemu-devel@patchwork.kernel.org; Fri, 08 Apr 2016 09:17:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53302) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aoWHi-0004oE-FS for qemu-devel@nongnu.org; Fri, 08 Apr 2016 09:17:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aoWHe-00081P-CA for qemu-devel@nongnu.org; Fri, 08 Apr 2016 09:17:14 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:55545) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aoWHe-00080x-5k for qemu-devel@nongnu.org; Fri, 08 Apr 2016 09:17:10 -0400 Received: from hhmail02.hh.imgtec.org (unknown [10.100.10.20]) by Websense Email with ESMTPS id 02356835C3D32; Fri, 8 Apr 2016 14:17:04 +0100 (IST) Received: from LEMAIL01.le.imgtec.org (192.168.152.62) by hhmail02.hh.imgtec.org (10.100.10.20) with Microsoft SMTP Server (TLS) id 14.3.266.1; Fri, 8 Apr 2016 14:17:07 +0100 Received: from jhogan-linux.le.imgtec.org (192.168.154.110) by LEMAIL01.le.imgtec.org (192.168.152.62) with Microsoft SMTP Server (TLS) id 14.3.266.1; Fri, 8 Apr 2016 14:17:06 +0100 From: James Hogan To: Date: Fri, 8 Apr 2016 14:16:33 +0100 Message-ID: <1460121394-31975-2-git-send-email-james.hogan@imgtec.com> X-Mailer: git-send-email 2.4.10 In-Reply-To: <1460121394-31975-1-git-send-email-james.hogan@imgtec.com> References: <1460121394-31975-1-git-send-email-james.hogan@imgtec.com> MIME-Version: 1.0 X-Originating-IP: [192.168.154.110] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 195.59.15.196 Subject: [Qemu-devel] [PATCH v2 1/2] seccomp: Whitelist cacheflush since 2.2.0 not 2.2.3 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jones , James Hogan , Aurelien Jarno , Eduardo Otubo Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The cacheflush system call (found on MIPS and ARM) has been included in the libseccomp header since 2.2.0, so include it back to that version. Previously it was only enabled since 2.2.3 since that is when it was enabled properly for ARM. This will allow seccomp support to be enabled for MIPS back to libseccomp 2.2.0. Signed-off-by: James Hogan Reviewed-By: Andrew Jones Cc: Eduardo Otubo Cc: Aurelien Jarno Acked-by: Eduardo Otubo --- Changes in v2: - Added Peter's comment --- qemu-seccomp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/qemu-seccomp.c b/qemu-seccomp.c index 2866e3c2a660..138ee022a8fe 100644 --- a/qemu-seccomp.c +++ b/qemu-seccomp.c @@ -16,11 +16,13 @@ #include #include "sysemu/seccomp.h" +/* For some architectures (notably ARM) cacheflush is not supported until + * libseccomp 2.2.3, but configure enforces that we are using a more recent + * version on those hosts, so it is OK for this check to be less strict. + */ #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 +#elif SCMP_VER_MAJOR == 2 && SCMP_VER_MINOR >= 2 #define HAVE_CACHEFLUSH #endif