summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/qemu/qemu/CVE-2015-7295_1.patch
diff options
context:
space:
mode:
authorArmin Kuster <akuster@mvista.com>2016-02-06 23:14:55 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-07 17:23:05 (GMT)
commit3c686ae0141ecd863442ba7654e65dc2480b6228 (patch)
treeb14e8100cd5d83884201c816e004fa67604f1c41 /meta/recipes-devtools/qemu/qemu/CVE-2015-7295_1.patch
parent27aeaab726aa2c5c62300dfd50cb598987bcd3ee (diff)
downloadpoky-3c686ae0141ecd863442ba7654e65dc2480b6228.tar.gz
qemu: Security fix CVE-2015-7295
CVE-2015-7295 Qemu: net: virtio-net possible remote DoS (From OE-Core rev: 74771f8c41aaede0ddfb86983c6841bd1f1c1f0f) (From OE-Core rev: 3a7c84952d40f95b0f34bc35eef4490ecc8da07e) Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/qemu/qemu/CVE-2015-7295_1.patch')
-rw-r--r--meta/recipes-devtools/qemu/qemu/CVE-2015-7295_1.patch63
1 files changed, 63 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2015-7295_1.patch b/meta/recipes-devtools/qemu/qemu/CVE-2015-7295_1.patch
new file mode 100644
index 0000000..bc41c45
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/CVE-2015-7295_1.patch
@@ -0,0 +1,63 @@
1From ce317461573bac12b10d67699b4ddf1f97cf066c Mon Sep 17 00:00:00 2001
2From: Jason Wang <jasowang@redhat.com>
3Date: Fri, 25 Sep 2015 13:21:28 +0800
4Subject: [PATCH] virtio: introduce virtqueue_unmap_sg()
5
6Factor out sg unmapping logic. This will be reused by the patch that
7can discard descriptor.
8
9Cc: Michael S. Tsirkin <mst@redhat.com>
10Cc: Andrew James <andrew.james@hpe.com>
11Signed-off-by: Jason Wang <jasowang@redhat.com>
12Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
13Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14
15Upstream-Status: Backport
16
17git.qemu.org/?p=qemu.git;a=commit;h=ce317461573bac12b10d67699b4ddf1f97cf066c
18
19CVE: CVE-2015-7295 patch #1
20[Yocto # 9013]
21
22Signed-off-by: Armin Kuster <akuster@mvista.com>
23
24---
25 hw/virtio/virtio.c | 14 ++++++++++----
26 1 file changed, 10 insertions(+), 4 deletions(-)
27
28Index: qemu-2.2.0/hw/virtio/virtio.c
29===================================================================
30--- qemu-2.2.0.orig/hw/virtio/virtio.c
31+++ qemu-2.2.0/hw/virtio/virtio.c
32@@ -240,14 +240,12 @@ int virtio_queue_empty(VirtQueue *vq)
33 return vring_avail_idx(vq) == vq->last_avail_idx;
34 }
35
36-void virtqueue_fill(VirtQueue *vq, const VirtQueueElement *elem,
37- unsigned int len, unsigned int idx)
38+static void virtqueue_unmap_sg(VirtQueue *vq, const VirtQueueElement *elem,
39+ unsigned int len)
40 {
41 unsigned int offset;
42 int i;
43
44- trace_virtqueue_fill(vq, elem, len, idx);
45-
46 offset = 0;
47 for (i = 0; i < elem->in_num; i++) {
48 size_t size = MIN(len - offset, elem->in_sg[i].iov_len);
49@@ -263,6 +261,14 @@ void virtqueue_fill(VirtQueue *vq, const
50 cpu_physical_memory_unmap(elem->out_sg[i].iov_base,
51 elem->out_sg[i].iov_len,
52 0, elem->out_sg[i].iov_len);
53+}
54+
55+void virtqueue_fill(VirtQueue *vq, const VirtQueueElement *elem,
56+ unsigned int len, unsigned int idx)
57+{
58+ trace_virtqueue_fill(vq, elem, len, idx);
59+
60+ virtqueue_unmap_sg(vq, elem, len);
61
62 idx = (idx + vring_used_idx(vq)) % vq->vring.num;
63