summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/qemu/qemu/CVE-2015-7295_3.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/qemu/qemu/CVE-2015-7295_3.patch')
-rw-r--r--meta/recipes-devtools/qemu/qemu/CVE-2015-7295_3.patch52
1 files changed, 52 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2015-7295_3.patch b/meta/recipes-devtools/qemu/qemu/CVE-2015-7295_3.patch
new file mode 100644
index 0000000000..74442e32f5
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/CVE-2015-7295_3.patch
@@ -0,0 +1,52 @@
1From 0cf33fb6b49a19de32859e2cdc6021334f448fb3 Mon Sep 17 00:00:00 2001
2From: Jason Wang <jasowang@redhat.com>
3Date: Fri, 25 Sep 2015 13:21:30 +0800
4Subject: [PATCH] virtio-net: correctly drop truncated packets
5
6When packet is truncated during receiving, we drop the packets but
7neither discard the descriptor nor add and signal used
8descriptor. This will lead several issues:
9
10- sg mappings are leaked
11- rx will be stalled if a lots of packets were truncated
12
13In order to be consistent with vhost, fix by discarding the descriptor
14in this case.
15
16Cc: Michael S. Tsirkin <mst@redhat.com>
17Signed-off-by: Jason Wang <jasowang@redhat.com>
18Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
19Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
20
21Upstream-Status: Backport
22
23git.qemu.org/?p=qemu.git;a=commit;h=0cf33fb6b49a19de32859e2cdc6021334f448fb3
24
25CVE: CVE-2015-7295 patch #3
26[Yocto # 9013]
27
28Signed-off-by: Armin Kuster <akuster@mvista.com>
29
30---
31 hw/net/virtio-net.c | 8 +-------
32 1 file changed, 1 insertion(+), 7 deletions(-)
33
34Index: qemu-2.4.0/hw/net/virtio-net.c
35===================================================================
36--- qemu-2.4.0.orig/hw/net/virtio-net.c
37+++ qemu-2.4.0/hw/net/virtio-net.c
38@@ -1086,13 +1086,7 @@ static ssize_t virtio_net_receive(NetCli
39 * must have consumed the complete packet.
40 * Otherwise, drop it. */
41 if (!n->mergeable_rx_bufs && offset < size) {
42-#if 0
43- error_report("virtio-net truncated non-mergeable packet: "
44- "i %zd mergeable %d offset %zd, size %zd, "
45- "guest hdr len %zd, host hdr len %zd",
46- i, n->mergeable_rx_bufs,
47- offset, size, n->guest_hdr_len, n->host_hdr_len);
48-#endif
49+ virtqueue_discard(q->rx_vq, &elem, total);
50 return size;
51 }
52