]> git.ipfire.org Git - thirdparty/qemu.git/commit
virtio-net: fix unmap leak
authorJason Wang <jasowang@redhat.com>
Thu, 27 Nov 2014 10:04:03 +0000 (18:04 +0800)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 7 Jan 2015 20:58:53 +0000 (14:58 -0600)
commitb28d7b585a2f58b5eaee523aad1b15713b212031
tree9a2787e366abe00d79ac4645ada2767b376647d3
parentcd2f44cc3e75afd059d6a1b8a08ea6892bb8853b
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>
(cherry picked from commit 771b6ed37e3aa188a7485560b949a41c6cf174dc)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/net/virtio-net.c