sandbox: disable -sandbox if CONFIG_SECCOMP undefined
PATCH v4 1/1 sandbox: disable -sandbox if CONFIG_SECCOMP undefined
If CONFIG_SECCOMP is undefined, the option 'elevateprivileges' remains compiled. This would make libvirt set the corresponding capability and then trigger failure during guest startup. This patch moves the code regarding seccomp command line options to qemu-seccomp.c file and wraps qemu_opts_foreach finding sandbox option with CONFIG_SECCOMP. Because parse_sandbox() is moved into qemu-seccomp.c file, change seccomp_start() to static function.
Signed-off-by Yi Min Zhao <[email protected]>
Reviewed-by Ján Tomko <[email protected]>
Tested-by Ján Tomko <[email protected]>
Acked-by Eduardo Otubo <[email protected]>
--- include/sysemu/seccomp.h | 3 +- qemu-seccomp.c | 121 ++++++++++++++++++++++++++++++++++++++++++++- vl.c | 124 +++-------------------------------------------- 3 files changed, 130 insertions(+), 118 deletions(-)
include/sysemu/seccomp.h +2 -1
@@ -21,5 +21,6 @@#define QEMU_SECCOMP_SET_SPAWN (1 << 3)#define QEMU_SECCOMP_SET_RESOURCECTL (1 << 4) -int seccomp_start (uint32_t seccomp_opts); +int parse_sandbox (void *opaque,QemuOpts *opts,Error **errp); +#endif
qemu-seccomp.c +120 -1
136 lines not on this page · raw message
vl.c +8 -116
170 lines not on this page · raw message
Signature · 1 line
Yi Min