qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/4] virtio-net: do not leak cpu mappings
@ 2014-11-25 14:42 Stefano Stabellini
  2014-11-25 14:43 ` [Qemu-devel] [PATCH 1/4] introduce virtqueue_unmap_sg Stefano Stabellini
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Stefano Stabellini @ 2014-11-25 14:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: xen-devel, mst, jasowang, Stefano Stabellini, pbonzini

Hi all,
this patch series fixes a cpu mapping leak in virtio-net.

The bug is caused by virtio_net_handle_ctrl: it maps the entire out_sg
iov, but then modifies it and reduces it (iov_discard_front), and only
unmap the reduced version of the iov.

This causes a crash when running on Xen, but the behaviour is obviously
incorrect without Xen too.

The patch series fixes the issue by allowing virtio_net_handle_ctrl to
unmap the original out_sg iov but still call virtqueue_fill and
virtqueue_flush on the modified iov.

The first three patches do not introduce any functional changes.


Stefano Stabellini (4):
      introduce virtqueue_unmap_sg
      use virtqueue_unmap_sg in virtqueue_fill
      move virtqueue_unmap_sg calls from virtqueue_fill to virtqueue_push
      virtio-net: do not leak cpu mappings

 hw/net/virtio-net.c        |    9 ++++++++-
 hw/virtio/virtio.c         |   43 ++++++++++++++++++++++++-------------------
 include/hw/virtio/virtio.h |    2 ++
 3 files changed, 34 insertions(+), 20 deletions(-)

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-11-25 17:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-25 14:42 [Qemu-devel] [PATCH 0/4] virtio-net: do not leak cpu mappings Stefano Stabellini
2014-11-25 14:43 ` [Qemu-devel] [PATCH 1/4] introduce virtqueue_unmap_sg Stefano Stabellini
2014-11-25 15:05   ` Peter Maydell
2014-11-25 15:28     ` Stefano Stabellini
2014-11-25 14:43 ` [Qemu-devel] [PATCH 2/4] use virtqueue_unmap_sg in virtqueue_fill Stefano Stabellini
2014-11-25 14:43 ` [Qemu-devel] [PATCH 3/4] move virtqueue_unmap_sg calls from virtqueue_fill to virtqueue_push Stefano Stabellini
2014-11-25 14:43 ` [Qemu-devel] [PATCH 4/4] virtio-net: do not leak cpu mappings Stefano Stabellini
2014-11-25 15:28 ` [Qemu-devel] [Xen-devel] [PATCH 0/4] " Fabio Fantoni
2014-11-25 17:09   ` Wei Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).