]> xenbits.xensource.com Git - xen.git/commitdiff
tools: Restrict configuration of qemu processes
authorJim Fehlig <jfehlig@suse.com>
Tue, 15 Mar 2016 01:14:15 +0000 (01:14 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 24 Mar 2016 14:35:05 +0000 (14:35 +0000)
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 <jfehlig@suse.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
tools/libxl/libxl_dm.c

index acf61a818245385585c8f9319e4b2bc0e4a8162e..f56775bc87a5235fdcb9fb235a3b79e97c77ff78 100644 (file)
@@ -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]
index 4aca38e2897424e57d0c7116591a1174cc689886..cfda24ce0a05c42a30718553079463c42f890314 100644 (file)
@@ -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");
     }