netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] vhost: Skip access checks on GIOVAs
@ 2020-10-03 10:01 Greg Kurz
  2020-10-03 10:01 ` [PATCH v3 1/3] vhost: Don't call access_ok() when using IOTLB Greg Kurz
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Greg Kurz @ 2020-10-03 10:01 UTC (permalink / raw)
  To: Michael S. Tsirkin, Jason Wang
  Cc: kvm, virtualization, netdev, linux-kernel, qemu-devel,
	Laurent Vivier, David Gibson

This series addresses some misuse around vring addresses provided by
userspace when using an IOTLB device. The misuse cause failures of
the VHOST_SET_VRING_ADDR ioctl on POWER, which in turn causes QEMU
to crash at migration time.

Jason suggested that we should use vhost_get_used_size() during the
review of v2. Fixed this in a preliminary patch (patch 2) and rebased
the vq_log_used_access_ok() helper on top (patch 3).

Note that I've also posted a patch for QEMU so that it skips the used
structure GIOVA when allocating the log bitmap. Otherwise QEMU fails to
allocate it because POWER puts GIOVAs very high in the address space (ie.
over 0x800000000000000ULL).

https://patchwork.ozlabs.org/project/qemu-devel/patch/160105498386.68108.2145229309875282336.stgit@bahia.lan/

v3:
 - patch 1: added Jason's ack
 - patch 2: new patch to use vhost_get_used_size()
 - patch 3: rebased patch 2 from v2

v2:
 - patch 1: move the (vq->ioltb) check from vhost_vq_access_ok() to
            vq_access_ok() as suggested by MST
 - patch 2: new patch

---

Greg Kurz (3):
      vhost: Don't call access_ok() when using IOTLB
      vhost: Use vhost_get_used_size() in vhost_vring_set_addr()
      vhost: Don't call log_access_ok() when using IOTLB


 drivers/vhost/vhost.c |   33 +++++++++++++++++++++++----------
 1 file changed, 23 insertions(+), 10 deletions(-)

--
Greg


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

end of thread, other threads:[~2020-10-11  6:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-03 10:01 [PATCH v3 0/3] vhost: Skip access checks on GIOVAs Greg Kurz
2020-10-03 10:01 ` [PATCH v3 1/3] vhost: Don't call access_ok() when using IOTLB Greg Kurz
2020-10-03 10:02 ` [PATCH v3 2/3] vhost: Use vhost_get_used_size() in vhost_vring_set_addr() Greg Kurz
2020-10-10  2:32   ` Jason Wang
2020-10-11  6:46     ` Michael S. Tsirkin
2020-10-03 10:02 ` [PATCH v3 3/3] vhost: Don't call log_access_ok() when using IOTLB Greg Kurz
2020-10-10  3:00   ` Jason Wang

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).