aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Otubo <otubo@linux.vnet.ibm.com>2012-08-14 18:44:07 -0300
committerAnthony Liguori <aliguori@us.ibm.com>2012-08-16 13:41:16 -0500
commit452dfbef600837c0e430564ea9e35138ef48f24c (patch)
tree0e2d03e17ad6fd37eea16f9b453d779bee78ce0c
parent2f668be77501c0232a84aafb6a066c9915987f0e (diff)
Adding seccomp calls to vl.c (v8)
Signed-off-by: Eduardo Otubo <otubo@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> --- 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.
-rw-r--r--vl.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/vl.c b/vl.c
index d01256a6a3..1010248dcd 100644
--- a/vl.c
+++ b/vl.c
@@ -63,6 +63,11 @@
#include <linux/ppdev.h>
#include <linux/parport.h>
#endif
+
+#ifdef CONFIG_SECCOMP
+#include "qemu-seccomp.h"
+#endif
+
#ifdef __sun__
#include <sys/stat.h>
#include <sys/ethernet.h>
@@ -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]);