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

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