Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
libvirt
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Libvirt Packaging Team
libvirt
Commits
7406ae5f
You need to sign in or sign up before continuing.
Commit
7406ae5f
authored
7 years ago
by
Guido Günther
Browse files
Options
Downloads
Patches
Plain Diff
CVE-2018-5748: qemu: avoid denial of service reading from QEMU monitor
Closes: #887700
parent
6748f2c3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
debian/patches/qemu-avoid-denial-of-service-reading-from-QEMU-monitor-CV.patch
+49
-0
49 additions, 0 deletions
...void-denial-of-service-reading-from-QEMU-monitor-CV.patch
debian/patches/series
+1
-0
1 addition, 0 deletions
debian/patches/series
with
50 additions
and
0 deletions
debian/patches/qemu-avoid-denial-of-service-reading-from-QEMU-monitor-CV.patch
0 → 100644
+
49
−
0
View file @
7406ae5f
From: "Daniel P. Berrange" <berrange@redhat.com>
Date: Tue, 16 Jan 2018 17:00:11 +0000
Subject: qemu: avoid denial of service reading from QEMU monitor
(CVE-2018-5748)
We read from QEMU until seeing a \r\n pair to indicate a completed reply
or event. To avoid memory denial-of-service though, we must have a size
limit on amount of data we buffer. 10 MB is large enough that it ought
to cope with normal QEMU replies, and small enough that we're not
consuming unreasonable mem.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
src/qemu/qemu_monitor.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 046caf0..85c7d68 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -55,6 +55,15 @@
VIR_LOG_INIT("qemu.qemu_monitor");
#define DEBUG_IO 0
#define DEBUG_RAW_IO 0
+/* We read from QEMU until seeing a \r\n pair to indicate a
+ * completed reply or event. To avoid memory denial-of-service
+ * though, we must have a size limit on amount of data we
+ * buffer. 10 MB is large enough that it ought to cope with
+ * normal QEMU replies, and small enough that we're not
+ * consuming unreasonable mem.
+ */
+#define QEMU_MONITOR_MAX_RESPONSE (10 * 1024 * 1024)
+
struct _qemuMonitor {
virObjectLockable parent;
@@ -575,6 +584,12 @@
qemuMonitorIORead(qemuMonitorPtr mon)
int ret = 0;
if (avail < 1024) {
+ if (mon->bufferLength >= QEMU_MONITOR_MAX_RESPONSE) {
+ virReportSystemError(ERANGE,
+ _("No complete monitor response found in %d bytes"),
+ QEMU_MONITOR_MAX_RESPONSE);
+ return -1;
+ }
if (VIR_REALLOC_N(mon->buffer,
mon->bufferLength + 1024) < 0)
return -1;
This diff is collapsed.
Click to expand it.
debian/patches/series
+
1
−
0
View file @
7406ae5f
...
...
@@ -19,3 +19,4 @@ Pass-GPG_TTY-env-var-to-the-ssh-binary.patch
apparmor-Allow-virt-aa-helper-to-access-the-name-service-.patch
Allow-libvirt-to-kill-unconfined-domains.patch
apparmor-allow-libvirt-to-send-term-signal-to-unconfined.patch
qemu-avoid-denial-of-service-reading-from-QEMU-monitor-CV.patch
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment