]> xenbits.xensource.com Git - 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 12:58:40 +0000 (13:58 +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>
src/libvirt.c
src/remote/remote_protocol.x

index 9f579a604db3f19d8ca1e7f0f47c68f700fd2f83..7fa675ac96b2f093f20172ab3b880906ca2effc8 100644 (file)
@@ -4611,6 +4611,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 810eeca5150f4d5b075bda1dff84eb35b9391e3a..f9426704ba693563029e92390a6bd95770383960 100644 (file)
@@ -3826,13 +3826,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,