diff options
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.patch | 52 |
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 @@ | |||
1 | From 0cf33fb6b49a19de32859e2cdc6021334f448fb3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jason Wang <jasowang@redhat.com> | ||
3 | Date: Fri, 25 Sep 2015 13:21:30 +0800 | ||
4 | Subject: [PATCH] virtio-net: correctly drop truncated packets | ||
5 | |||
6 | When packet is truncated during receiving, we drop the packets but | ||
7 | neither discard the descriptor nor add and signal used | ||
8 | descriptor. This will lead several issues: | ||
9 | |||
10 | - sg mappings are leaked | ||
11 | - rx will be stalled if a lots of packets were truncated | ||
12 | |||
13 | In order to be consistent with vhost, fix by discarding the descriptor | ||
14 | in this case. | ||
15 | |||
16 | Cc: Michael S. Tsirkin <mst@redhat.com> | ||
17 | Signed-off-by: Jason Wang <jasowang@redhat.com> | ||
18 | Reviewed-by: Michael S. Tsirkin <mst@redhat.com> | ||
19 | Signed-off-by: Michael S. Tsirkin <mst@redhat.com> | ||
20 | |||
21 | Upstream-Status: Backport | ||
22 | |||
23 | git.qemu.org/?p=qemu.git;a=commit;h=0cf33fb6b49a19de32859e2cdc6021334f448fb3 | ||
24 | |||
25 | CVE: CVE-2015-7295 patch #3 | ||
26 | [Yocto # 9013] | ||
27 | |||
28 | Signed-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 | |||
34 | Index: 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 | |||