Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Alexander_Naumov:SLE-12:Update
qemu.4227
0208-virtio-net-correctly-drop-truncated.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0208-virtio-net-correctly-drop-truncated.patch of Package qemu.4227
From e4eb5f6a98ba6dede011a4d6e241e2aa2a2d048b Mon Sep 17 00:00:00 2001 From: Jason Wang <jasowang@redhat.com> Date: Fri, 25 Sep 2015 13:21:30 +0800 Subject: [PATCH] virtio-net: correctly drop truncated packets When packet is truncated during receiving, we drop the packets but neither discard the descriptor nor add and signal used descriptor. This will lead several issues: - sg mappings are leaked - rx will be stalled if a lots of packets were truncated In order to be consistent with vhost, fix by discarding the descriptor in this case. Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> (cherry picked from commit 0cf33fb6b49a19de32859e2cdc6021334f448fb3) [BR: BSC#947159 CVE-2015-7295] Signed-off-by: Bruce Rogers <brogers@suse.com> --- hw/net/virtio-net.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index fb17919fac..62940bdb3b 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -1044,13 +1044,7 @@ static ssize_t virtio_net_receive(NetClientState *nc, const uint8_t *buf, size_t * must have consumed the complete packet. * Otherwise, drop it. */ if (!n->mergeable_rx_bufs && offset < size) { -#if 0 - error_report("virtio-net truncated non-mergeable packet: " - "i %zd mergeable %d offset %zd, size %zd, " - "guest hdr len %zd, host hdr len %zd", - i, n->mergeable_rx_bufs, - offset, size, n->guest_hdr_len, n->host_hdr_len); -#endif + virtqueue_discard(q->rx_vq, &elem, total); return size; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor