]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix perms for virConnectDomainXML{To,From}Native (CVE-2013-4401)
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 3 Oct 2013 15:37:57 +0000 (16:37 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 21 Oct 2013 13:20:22 +0000 (14:20 +0100)
The virConnectDomainXMLToNative API should require 'connect:write'
not 'connect:read', since it will trigger execution of the QEMU
binaries listed in the XML.

Also make virConnectDomainXMLFromNative API require a full
read-write connection and 'connect:write' permission. Although the
current impl doesn't trigger execution of QEMU, we should not
rely on that impl detail from an API permissioning POV.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
(cherry picked from commit 57687fd6bf7f6e1b3662c52f3f26c06ab19dc96c)

src/libvirt.c
src/remote/remote_protocol.x

index 07a3fd50224fc1dedabde7fc0a0ff7cc8a8e21d0..043ad29403805b5ca01ac5eb7fbfe21a27ebabe0 100644 (file)
@@ -4606,6 +4606,10 @@ char *virConnectDomainXMLFromNative(virConnectPtr conn,
         virDispatchError(NULL);
         return NULL;
     }
+    if (conn->flags & VIR_CONNECT_RO) {
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        goto error;
+    }
 
     virCheckNonNullArgGoto(nativeFormat, error);
     virCheckNonNullArgGoto(nativeConfig, error);
index a1c23da516498f97c49c8e303155bfd4f6d637e4..24c3f6c0d790c3f983acd8aa8fc92f06b1be9838 100644 (file)
@@ -3812,13 +3812,13 @@ enum remote_procedure {
 
     /**
      * @generate: both
-     * @acl: connect:read
+     * @acl: connect:write
      */
     REMOTE_PROC_CONNECT_DOMAIN_XML_FROM_NATIVE = 135,
 
     /**
      * @generate: both
-     * @acl: connect:read
+     * @acl: connect:write
      */
     REMOTE_PROC_CONNECT_DOMAIN_XML_TO_NATIVE = 136,