android_kernel_motorola_sm6375/drivers/vhost
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Stefano Garzarella a15cbe9b84 vhost: fix range used in translate_desc()
[ Upstream commit 98047313cdb46828093894d0ac8b1183b8b317f9 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-01-18 11:41:57 +01:00
..
Kconfig
Kconfig.vringh
Makefile
net.c Fix double fget() in vhost_net_set_backend() 2022-05-25 09:14:34 +02:00
scsi.c
test.c
test.h
vhost.c vhost: fix range used in translate_desc() 2023-01-18 11:41:57 +01:00
vhost.h
vringh.c vringh: Fix loop descriptors check in the indirect cases 2022-06-14 18:12:02 +02:00
vsock.c vhost/vsock: Use kvmalloc/kvfree for larger packets. 2022-10-26 13:22:25 +02:00