Received: from eggs.gnu.org ([208.118.235.92]:40421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1mKo-0003mU-N4 for qemu-devel@nongnu.org; Wed, 15 Aug 2012 18:45:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T1mKm-0001ov-HQ for qemu-devel@nongnu.org; Wed, 15 Aug 2012 18:45:06 -0400 Received: from e33.co.us.ibm.com ([32.97.110.151]:58661) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1mKm-0001lq-BB for qemu-devel@nongnu.org; Wed, 15 Aug 2012 18:45:04 -0400 Received: from /spool/local by e33.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 15 Aug 2012 16:45:02 -0600 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id BF307C40008 for ; Wed, 15 Aug 2012 16:44:54 -0600 (MDT) Received: from d03av06.boulder.ibm.com (d03av06.boulder.ibm.com [9.17.195.245]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q7FMioZn074632 for ; Wed, 15 Aug 2012 16:44:52 -0600 Received: from d03av06.boulder.ibm.com (loopback [127.0.0.1]) by d03av06.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q7FMk8Lm011251 for ; Wed, 15 Aug 2012 16:46:08 -0600 From: Anthony Liguori Date: Wed, 15 Aug 2012 17:44:41 -0500 Message-Id: <1345070682-8675-4-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1345070682-8675-1-git-send-email-aliguori@us.ibm.com> References: <1345070682-8675-1-git-send-email-aliguori@us.ibm.com> Subject: [Qemu-devel] [PATCH 3/4] Adding seccomp calls to vl.c (v8) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paul Moore , Anthony Liguori , Eduardo Otubo From: Eduardo Otubo Signed-off-by: Eduardo Otubo Signed-off-by: Anthony Liguori --- v1: - Full seccomp calls and data included in vl.c v1 -> v2: - Full seccomp calls and data removed from vl.c and put into separate qemu-seccomp.[ch] file. --- vl.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/vl.c b/vl.c index d01256a..1010248 100644 --- a/vl.c +++ b/vl.c @@ -63,6 +63,11 @@ #include #include #endif + +#ifdef CONFIG_SECCOMP +#include "qemu-seccomp.h" +#endif + #ifdef __sun__ #include #include @@ -2344,6 +2349,14 @@ int main(int argc, char **argv, char **envp) const char *trace_events = NULL; const char *trace_file = NULL; +#ifdef CONFIG_SECCOMP + if (seccomp_start() < 0) { + fprintf(stderr, + "seccomp: failed to install syscall filter in the kernel\n"); + exit(1); + } +#endif + atexit(qemu_run_exit_notifiers); error_set_progname(argv[0]); -- 1.7.5.4