Package: libvirt / 5.0.0-4

security/api-disallow-virConnectGetDomainCapabilities-on-read-only.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From: =?utf-8?q?J=C3=A1n_Tomko?= <jtomko@redhat.com>
Date: Fri, 14 Jun 2019 10:37:33 +0200
Subject: api: disallow virConnectGetDomainCapabilities on read-only
 connections
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

This API can be used to execute arbitrary emulators.
Forbid it on read-only connections.

Fixes: CVE-2019-10167
Signed-off-by: Ján Tomko <jtomko@redhat.com>
---
 src/libvirt-domain.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 3d198d2..9b10790 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -11361,6 +11361,7 @@ virConnectGetDomainCapabilities(virConnectPtr conn,
     virResetLastError();
 
     virCheckConnectReturn(conn, NULL);
+    virCheckReadOnlyGoto(conn->flags, error);
 
     if (conn->driver->connectGetDomainCapabilities) {
         char *ret;