Blame SOURCES/libvirt-api-disallow-virConnectGetDomainCapabilities-on-read-only-connections.patch

99cbc7
From fae17c4141d504073e9cb16b49d2af9e73272ac2 Mon Sep 17 00:00:00 2001
99cbc7
Message-Id: <fae17c4141d504073e9cb16b49d2af9e73272ac2@dist-git>
99cbc7
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
99cbc7
Date: Tue, 18 Jun 2019 13:30:01 +0200
99cbc7
Subject: [PATCH] api: disallow virConnectGetDomainCapabilities on read-only
99cbc7
 connections
99cbc7
MIME-Version: 1.0
99cbc7
Content-Type: text/plain; charset=UTF-8
99cbc7
Content-Transfer-Encoding: 8bit
99cbc7
99cbc7
This API can be used to execute arbitrary emulators.
99cbc7
Forbid it on read-only connections.
99cbc7
99cbc7
Fixes: CVE-2019-10167
99cbc7
Signed-off-by: Ján Tomko <jtomko@redhat.com>
99cbc7
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
99cbc7
Signed-off-by: Ján Tomko <jtomko@redhat.com>
99cbc7
Message-Id: <eeefd7cf2afba696bed78582e086bfbd3ed23e00.1560857354.git.jtomko@redhat.com>
99cbc7
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
99cbc7
---
99cbc7
 src/libvirt-domain.c | 1 +
99cbc7
 1 file changed, 1 insertion(+)
99cbc7
99cbc7
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
99cbc7
index b936dd8eb7..ab2c44cfe1 100644
99cbc7
--- a/src/libvirt-domain.c
99cbc7
+++ b/src/libvirt-domain.c
99cbc7
@@ -11287,6 +11287,7 @@ virConnectGetDomainCapabilities(virConnectPtr conn,
99cbc7
     virResetLastError();
99cbc7
 
99cbc7
     virCheckConnectReturn(conn, NULL);
99cbc7
+    virCheckReadOnlyGoto(conn->flags, error);
99cbc7
 
99cbc7
     if (conn->driver->connectGetDomainCapabilities) {
99cbc7
         char *ret;
99cbc7
-- 
99cbc7
2.22.0
99cbc7