Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Alexander_Naumov:SLE-12:Update
qemu-linux-user.7445
0207-virtio-introduce-virtqueue_discard.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0207-virtio-introduce-virtqueue_discard.patch of Package qemu-linux-user.7445
From 82f4534a1ed15505b0047ae871e8887fa1be6992 Mon Sep 17 00:00:00 2001 From: Jason Wang <jasowang@redhat.com> Date: Fri, 25 Sep 2015 13:21:29 +0800 Subject: [PATCH] virtio: introduce virtqueue_discard() This patch introduces virtqueue_discard() to discard a descriptor and unmap the sgs. This will be used by the patch that will discard descriptor when packet is truncated. 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 29b9f5efd78ae0f9cc02dd169b6e80d2c404bade) [BR: BSC#947159 CVE-2015-7295] Signed-off-by: Bruce Rogers <brogers@suse.com> --- hw/virtio/virtio.c | 7 +++++++ include/hw/virtio/virtio.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 33a6b273f6..c3457ec393 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -263,6 +263,13 @@ static void virtqueue_unmap_sg(VirtQueue *vq, const VirtQueueElement *elem, 0, elem->out_sg[i].iov_len); } +void virtqueue_discard(VirtQueue *vq, const VirtQueueElement *elem, + unsigned int len) +{ + vq->last_avail_idx--; + virtqueue_unmap_sg(vq, elem, len); +} + void virtqueue_fill(VirtQueue *vq, const VirtQueueElement *elem, unsigned int len, unsigned int idx) { diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index a60104ca24..038c65c28a 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -177,6 +177,8 @@ void virtio_del_queue(VirtIODevice *vdev, int n); void virtqueue_push(VirtQueue *vq, const VirtQueueElement *elem, unsigned int len); void virtqueue_flush(VirtQueue *vq, unsigned int count); +void virtqueue_discard(VirtQueue *vq, const VirtQueueElement *elem, + unsigned int len); void virtqueue_fill(VirtQueue *vq, const VirtQueueElement *elem, unsigned int len, unsigned int idx);
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