From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56029) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0ztR-00006g-BO for qemu-devel@nongnu.org; Mon, 13 Aug 2012 15:01:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T0ztP-0006gH-9R for qemu-devel@nongnu.org; Mon, 13 Aug 2012 15:01:37 -0400 Received: from e24smtp05.br.ibm.com ([32.104.18.26]:59298) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0ztO-0006fg-UU for qemu-devel@nongnu.org; Mon, 13 Aug 2012 15:01:35 -0400 Received: from /spool/local by e24smtp05.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 13 Aug 2012 16:01:32 -0300 Received: from d24relay01.br.ibm.com (d24relay01.br.ibm.com [9.8.31.16]) by d24dlp02.br.ibm.com (Postfix) with ESMTP id 64D481DC004F for ; Mon, 13 Aug 2012 15:01:30 -0400 (EDT) Received: from d24av03.br.ibm.com (d24av03.br.ibm.com [9.8.31.95]) by d24relay01.br.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q7DIvU5L2732068 for ; Mon, 13 Aug 2012 15:57:30 -0300 Received: from d24av03.br.ibm.com (loopback [127.0.0.1]) by d24av03.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q7DH1l8o026849 for ; Mon, 13 Aug 2012 14:01:48 -0300 From: Eduardo Otubo Date: Mon, 13 Aug 2012 16:01:08 -0300 Message-Id: <1344884468-11065-4-git-send-email-otubo@linux.vnet.ibm.com> In-Reply-To: <1344884468-11065-1-git-send-email-otubo@linux.vnet.ibm.com> References: <1344884468-11065-1-git-send-email-otubo@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH v6 3/3] Adding seccomp calls to vl.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pmoore@redhat.com, aliguori@us.ibm.com, wad@chromium.org, coreyb@linux.vnet.ibm.com, blauwirbel@gmail.com, Eduardo Otubo v1: * Full seccomp calls and data included in vl.c v2: * Full seccomp calls and data removed from vl.c and put into separate qemu-seccomp.[ch] file. Signed-off-by: Eduardo Otubo --- vl.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/vl.c b/vl.c index 91076f0..2c62efc 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 @@ -2299,6 +2304,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.1