OSDN Git Service

virtio-net: fix unmap leak
authorJason Wang <jasowang@redhat.com>
Thu, 27 Nov 2014 10:04:03 +0000 (18:04 +0800)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 28 Nov 2014 10:29:20 +0000 (10:29 +0000)
commit771b6ed37e3aa188a7485560b949a41c6cf174dc
treeacf3136ca16ec7df6807947cb7f38569a1e6933e
parent4cae4d5acaea23f3def84c8dc67ef5106323e5cb
virtio-net: fix unmap leak

virtio_net_handle_ctrl() and other functions that process control vq
request call iov_discard_front() which will shorten the iov. This will
lead unmapping in virtqueue_push() leaks mapping.

Fixes this by keeping the original iov untouched and using a temp variable
in those functions.

Cc: Wen Congyang <wency@cn.fujitsu.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-id: 1417082643-23907-1-git-send-email-jasowang@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/net/virtio-net.c