summary refs log tree commit diff
path: root/gnu/packages/patches/qemu-CVE-2019-6778.patch
diff options
context:
space:
mode:
authorLeo Famulari <leo@famulari.name>2019-01-29 14:57:29 -0500
committerLeo Famulari <leo@famulari.name>2019-01-31 14:35:48 +0100
commit11d19ca236c62ffdbb98a3a3580caf09cc37b6de (patch)
tree61d5c1a1081dc7a3aa6b75292b73502b7c618249 /gnu/packages/patches/qemu-CVE-2019-6778.patch
parenta382860bd418ef1d8939804a9539747a649ce1db (diff)
downloadguix-11d19ca236c62ffdbb98a3a3580caf09cc37b6de.tar.gz
gnu: QEMU: Fix CVE-2018-16872 and CVE-2019-6778.
* gnu/packages/patches/qemu-CVE-2018-16872.patch,
gnu/packages/patches/qemu-CVE-2019-6778.patch: New files.
* gnu/local.mk (dist_patch_DATA): Add them.
* gnu/packages/virtualization.scm (qemu)[source]: Use them.
Diffstat (limited to 'gnu/packages/patches/qemu-CVE-2019-6778.patch')
-rw-r--r--gnu/packages/patches/qemu-CVE-2019-6778.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/gnu/packages/patches/qemu-CVE-2019-6778.patch b/gnu/packages/patches/qemu-CVE-2019-6778.patch
new file mode 100644
index 0000000000..315f2922da
--- /dev/null
+++ b/gnu/packages/patches/qemu-CVE-2019-6778.patch
@@ -0,0 +1,43 @@
+Fixes CVE-2019-6778:
+
+https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-6778
+
+Patch copied from upstream source repository:
+
+https://git.qemu.org/?p=qemu.git;a=commitdiff;h=a7104eda7dab99d0cdbd3595c211864cba415905
+
+From a7104eda7dab99d0cdbd3595c211864cba415905 Mon Sep 17 00:00:00 2001
+From: Prasad J Pandit <pjp@fedoraproject.org>
+Date: Sun, 13 Jan 2019 23:29:48 +0530
+Subject: [PATCH] slirp: check data length while emulating ident function
+
+While emulating identification protocol, tcp_emu() does not check
+available space in the 'sc_rcv->sb_data' buffer. It could lead to
+heap buffer overflow issue. Add check to avoid it.
+
+Reported-by: Kira <864786842@qq.com>
+Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
+Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
+---
+ slirp/tcp_subr.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c
+index 4a9a5b5edc..23a841f26e 100644
+--- a/slirp/tcp_subr.c
++++ b/slirp/tcp_subr.c
+@@ -634,6 +634,11 @@ tcp_emu(struct socket *so, struct mbuf *m)
+ 			socklen_t addrlen = sizeof(struct sockaddr_in);
+ 			struct sbuf *so_rcv = &so->so_rcv;
+ 
++			if (m->m_len > so_rcv->sb_datalen
++					- (so_rcv->sb_wptr - so_rcv->sb_data)) {
++			    return 1;
++			}
++
+ 			memcpy(so_rcv->sb_wptr, m->m_data, m->m_len);
+ 			so_rcv->sb_wptr += m->m_len;
+ 			so_rcv->sb_rptr += m->m_len;
+-- 
+2.20.1
+