From: Jim Fehlig Date: Tue, 15 Mar 2016 01:14:15 +0000 (+0000) Subject: tools: Restrict configuration of qemu processes X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~1501 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=803aea1dd801b7a2a084323151f681078e30b7f9;p=xen.git tools: Restrict configuration of qemu processes Commit 6ef823fd added '-nodefaults' to the qemu args created by libxl, which is a good step in restricting qemu's default configuration. This change takes another step by adding -no-user-config, which ignores any user-provided config files in sysconfdir. Together, -nodefaults and -no-user-config allow Xen to avoid unkown and uncontrolled qemu configuration. Both options are also added to the qemu invocation in the xen-qemu-dom0-disk-backend systemd service file. Signed-off-by: Jim Fehlig Acked-by: Wei Liu --- diff --git a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in index acf61a8182..f56775bc87 100644 --- a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in +++ b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in @@ -14,6 +14,7 @@ ExecStartPre=/bin/mkdir -p @XEN_RUN_DIR@ ExecStart=@qemu_xen_systemd@ -xen-domid 0 \ -xen-attach -name dom0 -nographic -M xenpv -daemonize \ -monitor /dev/null -serial /dev/null -parallel /dev/null \ + -nodefaults -no-user-config \ -pidfile @XEN_RUN_DIR@/qemu-dom0.pid [Install] diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index 4aca38e289..cfda24ce0a 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -828,6 +828,12 @@ static int libxl__build_device_model_args_new(libxl__gc *gc, */ flexarray_append(dm_args, "-nodefaults"); + /* + * Do not use any of the user-provided config files in sysconfdir, + * avoiding unkown and uncontrolled configuration. + */ + flexarray_append(dm_args, "-no-user-config"); + if (b_info->type == LIBXL_DOMAIN_TYPE_PV) { flexarray_append(dm_args, "-xen-attach"); }