linux/drivers/vhost
Stefano Garzarella 98047313cd vhost: fix range used in translate_desc()
vhost_iotlb_itree_first() requires `start` and `last` parameters
to search for a mapping that overlaps the range.

In translate_desc() we cyclically call vhost_iotlb_itree_first(),
incrementing `addr` by the amount already translated, so rightly
we move the `start` parameter passed to vhost_iotlb_itree_first(),
but we should hold the `last` parameter constant.

Let's fix it by saving the `last` parameter value before incrementing
`addr` in the loop.

Fixes: a9709d6874 ("vhost: convert pre sorted vhost memory array to interval tree")
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20221109102503.18816-3-sgarzare@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2022-12-28 05:28:10 -05:00
..
iotlb.c vhost_iotlb: split out IOTLB initialization 2022-05-31 12:44:28 -04:00
Kconfig vhost_vdpa: implement IRQ offloading in vhost_vdpa 2020-08-05 11:08:42 -04:00
Makefile vhost: introduce vDPA-based backend 2020-04-02 10:41:40 -04:00
net.c use less confusing names for iov_iter direction initializers 2022-11-25 13:01:55 -05:00
scsi.c use less confusing names for iov_iter direction initializers 2022-11-25 13:01:55 -05:00
test.c vhost: rename vhost_work_dev_flush 2022-05-31 12:45:10 -04:00
test.h tools/virtio: Add --reset 2020-06-22 12:34:21 -04:00
vdpa.c vhost-vdpa: uAPI to suspend the device 2022-08-11 04:31:15 -04:00
vhost.c vhost: fix range used in translate_desc() 2022-12-28 05:28:10 -05:00
vhost.h vhost: rename vhost_work_dev_flush 2022-05-31 12:45:10 -04:00
vringh.c vringh: fix range used in iotlb_translate() 2022-12-28 05:28:10 -05:00
vsock.c vhost/vsock: Fix error handling in vhost_vsock_init() 2022-12-28 05:28:10 -05:00