df3a49
From b3feb1b383093fd4964de274bf6c96aade1a6d7e Mon Sep 17 00:00:00 2001
df3a49
Message-Id: <b3feb1b383093fd4964de274bf6c96aade1a6d7e@dist-git>
df3a49
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
df3a49
Date: Wed, 15 May 2019 21:40:58 +0100
df3a49
Subject: [PATCH] logging: restrict sockets to mode 0600
df3a49
MIME-Version: 1.0
df3a49
Content-Type: text/plain; charset=UTF-8
df3a49
Content-Transfer-Encoding: 8bit
df3a49
df3a49
The virtlogd daemon's only intended client is the libvirtd daemon. As
df3a49
such it should never allow clients from other user accounts to connect.
df3a49
The code already enforces this and drops clients from other UIDs, but
df3a49
we can get earlier (and thus stronger) protection against DoS by setting
df3a49
the socket permissions to 0600
df3a49
df3a49
Fixes CVE-2019-10132
df3a49
df3a49
Reviewed-by: Ján Tomko <jtomko@redhat.com>
df3a49
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
df3a49
(cherry picked from a private commit)
df3a49
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
df3a49
Message-Id: <20190515204058.28077-4-berrange@redhat.com>
df3a49
---
df3a49
 src/logging/virtlogd-admin.socket.in | 1 +
df3a49
 src/logging/virtlogd.socket.in       | 1 +
df3a49
 2 files changed, 2 insertions(+)
df3a49
df3a49
diff --git a/src/logging/virtlogd-admin.socket.in b/src/logging/virtlogd-admin.socket.in
df3a49
index 595e6c4c4b..5c41dfeb7b 100644
df3a49
--- a/src/logging/virtlogd-admin.socket.in
df3a49
+++ b/src/logging/virtlogd-admin.socket.in
df3a49
@@ -5,6 +5,7 @@ Before=libvirtd.service
df3a49
 [Socket]
df3a49
 ListenStream=@localstatedir@/run/libvirt/virtlogd-admin-sock
df3a49
 Service=virtlogd.service
df3a49
+SocketMode=0600
df3a49
 
df3a49
 [Install]
df3a49
 WantedBy=sockets.target
df3a49
diff --git a/src/logging/virtlogd.socket.in b/src/logging/virtlogd.socket.in
df3a49
index 22b9360c8d..ae48cdab9a 100644
df3a49
--- a/src/logging/virtlogd.socket.in
df3a49
+++ b/src/logging/virtlogd.socket.in
df3a49
@@ -4,6 +4,7 @@ Before=libvirtd.service
df3a49
 
df3a49
 [Socket]
df3a49
 ListenStream=@localstatedir@/run/libvirt/virtlogd-sock
df3a49
+SocketMode=0600
df3a49
 
df3a49
 [Install]
df3a49
 WantedBy=sockets.target
df3a49
-- 
df3a49
2.21.0
df3a49