summaryrefslogtreecommitdiff
path: root/qemu-seccomp.h
diff options
context:
space:
mode:
authorEduardo Otubo <otubo@linux.vnet.ibm.com>2012-08-14 18:44:06 -0300
committerAnthony Liguori <aliguori@us.ibm.com>2012-08-16 13:41:16 -0500
commit2f668be77501c0232a84aafb6a066c9915987f0e (patch)
tree92b0922eca670dff7e3e8ff0d37a88fc2cdedb20 /qemu-seccomp.h
parentf794573eab564548fa7aa463b5908b0042c0e6a4 (diff)
downloadqemu-2f668be77501c0232a84aafb6a066c9915987f0e.tar.gz
qemu-2f668be77501c0232a84aafb6a066c9915987f0e.tar.bz2
qemu-2f668be77501c0232a84aafb6a066c9915987f0e.zip
Adding qemu-seccomp.[ch] (v8)
Signed-off-by: Eduardo Otubo <otubo@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> --- v1: - I added a syscall struct using priority levels as described in the libseccomp man page. The priority numbers are based to the frequency they appear in a sample strace from a regular qemu guest run under libvirt. Libseccomp generates linear BPF code to filter system calls, those rules are read one after another. The priority system places the most common rules first in order to reduce the overhead when processing them. v1 -> v2: - Fixed some style issues - Removed code from vl.c and created qemu-seccomp.[ch] - Now using ARRAY_SIZE macro - Added more syscalls without priority/frequency set yet v2 -> v3: - Adding copyright and license information - Replacing seccomp_whitelist_count just by ARRAY_SIZE - Adding header protection to qemu-seccomp.h - Moving QemuSeccompSyscall definition to qemu-seccomp.c - Negative return from seccomp_start is fatal now. - Adding open() and execve() to the whitelis v3 -> v4: - Tests revealed a bigger set of syscalls. - seccomp_start() now has an argument to set the mode according to the configure option trap or kill. v4 -> v5: - Tests on x86_64 required a new specific set of system calls. - libseccomp release 1.0.0: part of the API have changed in this last release, had to adapt to the new function signatures.
Diffstat (limited to 'qemu-seccomp.h')
-rw-r--r--qemu-seccomp.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/qemu-seccomp.h b/qemu-seccomp.h
new file mode 100644
index 0000000000..b2fc3f8c3c
--- /dev/null
+++ b/qemu-seccomp.h
@@ -0,0 +1,22 @@
+/*
+ * QEMU seccomp mode 2 support with libseccomp
+ *
+ * Copyright IBM, Corp. 2012
+ *
+ * Authors:
+ * Eduardo Otubo <eotubo@br.ibm.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2. See
+ * the COPYING file in the top-level directory.
+ *
+ * Contributions after 2012-01-13 are licensed under the terms of the
+ * GNU GPL, version 2 or (at your option) any later version.
+ */
+#ifndef QEMU_SECCOMP_H
+#define QEMU_SECCOMP_H
+
+#include <seccomp.h>
+#include "osdep.h"
+
+int seccomp_start(void);
+#endif